home *** CD-ROM | disk | FTP | other *** search
/ Computer Inter@ctive 17 / Computer Interactive cdrom 17 - gen 99.iso / ZDNETIT / CONTENT / OPTIVDOS.ZIP / DOC.ZIP / FUNCREF.TXT < prev    next >
Encoding:
Text File  |  1998-10-21  |  385.8 KB  |  6,776 lines

  1.        OOOOOO                            VV        VV
  2.       OO    OO   PPPPPPP   TTTTTTTT  II   VV      VV  EEEEEE   CCCCCC
  3.       OO    OO   PP    PP     TT     II    VV    VV   EE       CC
  4.       OO    OO   PPPPPPP      TT     II     VV   VV   EEEEEE   CC
  5.       OO    OO   PP           TT     II       VVV     EE       CC
  6.        OOOOOO    PP           TT     II        V      EEEEEE   CCCCCC
  7.  
  8.  
  9.                        OptiVec Version 1.2
  10.                          for Borland C++
  11.                      (Version 3.0 or higher)
  12.  
  13.             Part Two: Function Reference for VectorLib
  14.  
  15.  
  16.                      Dr. Martin Sander Software Development
  17.                      Sertürnerstr. 11
  18.                      D-37085 Göttingen
  19.                      Germany
  20.                      e-mail: MartinSander@Bigfoot.com
  21.                      http://www.optivec.com
  22.  
  23. ****************************************************************************
  24.  
  25. S e c o n d  P a r t :   File  FUNCREF.TXT 
  26.  
  27. !!     This is an ASCII text file!  It is best viewed with a simple        !!
  28. !!     DOS editor.                                                         !!
  29. !!     If you load this file into a word processor under Windows, you      !!
  30. !!     must use the filter "DOS text".                                     !!
  31. !!     Alternatively, you may use FCONVERT (shipped with Borland C++) to   !!
  32. !!     convert from ASCII (OEM) into the ANSI character set.               !!
  33. !!     Preferrably use the lettertype CourierNew 10 pt.                    !!
  34.  
  35. A general description of VectorLib is given in the  F i r s t  P a r t
  36. of this documentation, in the file HANDBOOK.TXT.
  37. Chapter 1.2 of that file contains the licence terms.
  38.  
  39. Copyright for the Software and its documentation (C) 1996-1998 Martin Sander
  40.  
  41.  
  42. ****************************************************************************
  43. *                                                                          *
  44. *******                8. Alphabetical Reference                     *******
  45. *                                                                          *
  46. ****************************************************************************
  47.  
  48.  
  49. The functions are alphabetically ordered, with the prefixes being neglected
  50. for the ordering. The heading of each entry lists all the versions available
  51. of a specific function. For example, the "abs" family of functions exists in
  52. vectorized versions for
  53. -  the three real-number data types float, double, and extended (long double)
  54.    with the prefixes VF_, VD_, and VE_,
  55. -  for the three complex-number data types (prefixes VCF_, VCD_, and VCE_),
  56. -  and for the signed integer data types int, short int, long int and quad
  57.    (prefixes VI_, VSI_, VLI_, and VQI);
  58. unsigned numbers are, by their very definition, always positive, and it makes
  59. no sense to define the operation "abs" for them; consequently, the VU_, VUS_,
  60. VUL_, and VUI_  versions are missing.
  61.  
  62. The lines following the heading describe the use of the respective functions
  63. in greater detail:
  64. Syntax          In most cases, only the VF_ version is described. All other
  65.                 versions are exactly analogous; one has only to replace the
  66.                 data types float and fVector by the appropriate ones and
  67.                 replace the  VF... include file by the one belonging to the
  68.                 desired data type.
  69. Description     Often, for the sake of simplicity, the brackets around vector
  70.                 element indices are left away.
  71.                 If not stated otherwise, all vector elements from the zero'th
  72.                 up to the last one (with the index  size-1) are subjected to
  73.                 the respective operation described.
  74.                 Thus, a formula like     Yi = │ Xi │   is to be understood
  75.                 as an abbreviation for   Y[i] = │ X[i] │,  i=0,...,size-1
  76.                 or, written as a loop:
  77.                     for( i=0; i<size; i++ ) Y[i] = fabs( X[i] );
  78. Error handling  All types of errors are listed which are detected and handled.
  79.                 The default result is given in each case. In case of any
  80.                 detected floating-point errors, _matherr or _matherrl are
  81.                 called (see chapter 5.3). Although we do not recommend that,
  82.                 the user may modify _matherr and _matherrl such as to specify
  83.                 other results than those suggested.
  84. Return value    The return value of the respective function is mentioned here.
  85. See also        References to functions without a prefix "V..." refer to
  86.                 the documentation of Borland C.
  87.  
  88. References to chapters 1. to 7. refer to the  F i r s t  P a r t  of this
  89. documentation. See the file HANDBOOK.TXT.
  90.  
  91.  
  92. ┌────────────────────────────────────────────────────────────────────────────┐
  93. │ VF_abs                   VD_abs                   VE_abs                   │
  94. │ VCF_abs                  VCD_abs                  VCE_abs                  │
  95. │ VI_abs              VSI_abs             VLI_abs             VQI_abs        │
  96. └────────────────────────────────────────────────────────────────────────────┘
  97. Function        Absolute value
  98. Syntax          #include <VFmath.h>
  99.                 int  VF_abs(   fVector Y,  fVector X,  ui size );
  100.                        (similarly VD_, VE_, VSI_, VI_, VLI_, VQI_)
  101.                 int  VCF_abs(  fVector Y,  cfVector X, ui size );
  102.                        (similarly VCD_, VCE_)
  103. Description     Real and integer versions:    Yi  =  │ Xi │
  104.                 VSI_,  VI_, and VLI_ versions only: due to the implicit
  105.                    modulo-2**n arithmetics, the absolute value of the most
  106.                    negative numbers possible ( -32768 for short, -2147483648
  107.                    for long) is stored as the same negative (!) number
  108.                    (-32768 or -2147483648, resp.).
  109.                 Complex versions:      Yi  = sqrt( Xi.Re² + Xi.Im² )
  110.                 For the complex versions, note that the result is real-
  111.                    valued. The same result may also be obtained slightly
  112.                    faster, but without error handling, using VF_CtoAbs.
  113. Error handling  Real and integer versions: no errors should occur;
  114.                 Complex versions: OVERFLOW errors lead to the default result
  115.                 +HUGE_VAL.
  116. Return value    Floating-point versions: 0, if error-free, otherwise != 0.
  117.                 The integer versions have no return value.
  118. See also        VF_neg,  VCF_abs,  VCF_conj
  119.  
  120.  
  121. ┌────────────────────────────────────────────────────────────────────────────┐
  122. │ VF_absmax                VD_absmax                VE_absmax                │
  123. │ VCF_absmax               VCD_absmax               VCE_absmax               │
  124. └────────────────────────────────────────────────────────────────────────────┘
  125. Function        Largest absolute value within one vector
  126. Syntax          #include <VFstd.h>
  127.                 float VF_absmax( fVector X, ui size );
  128.                        (similarly VD_,  VE_)
  129.                 float VCF_absmax( cfVector X, ui size);
  130.                        (similarly VCD_, VCE_)
  131. Description     The absolute values of all elements of a vector are compared
  132.                 and the largest returned. For complex numbers, the magnitudes
  133.                 of the elements are compared and the largest returned. In
  134.                 order to find the greatest real and imaginary parts
  135.                 separately, please use VCF_absmaxReIm.
  136. Error handling  none
  137. Return value    maximum absolute value encountered.
  138. See also        VF_max, VF_absmin, VF_runmax, VF_absmaxind, VCF_absmaxReIm
  139.  
  140.  
  141. ┌────────────────────────────────────────────────────────────────────────────┐
  142. │ VF_absmaxind             VD_absmaxind             VE_absmaxind             │
  143. │ VCF_absmaxind            VCD_absmaxind            VCE_absmaxind            │
  144. └────────────────────────────────────────────────────────────────────────────┘
  145. Function        Largest absolute value and its index
  146. Syntax          #include <VFstd.h>
  147.                 float  VF_absmaxind( ui *Ind, fVector X, ui size );
  148.                        (similarly VD_,  VE_)
  149.                 float  VCF_absmaxind( ui *Ind, cfVector X, ui size );
  150.                        (similarly VCD_, VCE_)
  151. Description     The absolute values of all elements of a vector are compared
  152.                 and the largest returned. For complex numbers, the magnitudes
  153.                 of the elements are compared and the largest returned. The
  154.                 index of this maximum is stored at the address given by Ind.
  155.                 In case of more than one element with the same maximum value,
  156.                 the lowest index is chosen.
  157. Error handling  none
  158. Return value    maximum absolute value encountered.
  159. See also        VF_maxind, VF_absmax, VF_runmax, VF_maxind, VCF_absmaxReIm
  160.  
  161.  
  162. ┌────────────────────────────────────────────────────────────────────────────┐
  163. │ VCF_absmaxReIm           VCD_absmaxReIm           VCE_absmaxReIm           │
  164. └────────────────────────────────────────────────────────────────────────────┘
  165. Function        Separate determination of the largest absolute values of the
  166.                 real and imaginary parts occurring in a complex vector.
  167. Syntax          #include <VCFstd.h>
  168.                 fComplex  VCF_absmaxReIm( cfVector X, ui size );
  169.                        (similarly VCD_, VCE_)
  170. Description     The absolute values of the real parts of all vector elements
  171.                 are compared with each other and the largest one is returned
  172.                 as the real part of the result. Similarly, the absolute values
  173.                 of all the imaginary parts are compared with each other and
  174.                 the largest one is returned as the imaginary part of the
  175.                 result. Generally, the result is made up from different
  176.                 elements of the vector.
  177. Error handling  none
  178. Return value    Largest absolute real and imaginary parts, combined into one
  179.                 complex number.
  180. See also        VCF_maxReIm, VCF_absminReIm
  181.  
  182.  
  183. ┌────────────────────────────────────────────────────────────────────────────┐
  184. │ VF_absmin                VD_absmin                VE_absmin                │
  185. │ VCF_absmin               VCD_absmin               VCE_absmin               │
  186. └────────────────────────────────────────────────────────────────────────────┘
  187. Function        Smallest absolute value within one vector
  188. Syntax          #include <VFstd.h>
  189.                 float VF_absmin( fVector X, ui size );
  190.                       (similarly VD_,  VE_)
  191.                 float VCF_absmin( cfVector X, ui size );
  192.                       (similarly( VCD_, VCE_)
  193. Description     The absolute values of all elements of a vector are compared
  194.                 and the smallest returned. For complex numbers, the magnitudes
  195.                 of the elements are compared and the smallest returned. In
  196.                 order to find the smallest real and imaginary parts
  197.                 separately, please use VCF_absminReIm.
  198. Error handling  none
  199. Return value    minimum absolute value encountered.
  200. See also        VF_min, VF_absmax, VF_runmin, VF_minind, VCF_absminReIm
  201.  
  202.  
  203. ┌────────────────────────────────────────────────────────────────────────────┐
  204. │ VF_absminind             VD_absminind             VE_absminind             │
  205. │ VCF_absminind            VCD_absminind            VCE_absminind            │
  206. └────────────────────────────────────────────────────────────────────────────┘
  207. Function        Smallest absolute value and the index of its first
  208.                 occurrence.
  209. Syntax          #include <VFstd.h>
  210.                 float  VF_absminind(  ui *Ind, fVector X, ui size );
  211.                       (similarly VD_,  VE_)
  212.                 float  VCF_absminind( ui *Ind, cfVector X, ui size );
  213.                       (similarly VCD_, VCE_)
  214. Description     The absolute values of all elements of a vector are compared
  215.                 and the smallest returned. For complex numbers, the magnitudes
  216.                 of the elements are compared and the smallest returned. The
  217.                 index of this minimum is stored at the address given by Ind.
  218.                 In case of more than one element with the same minimum value,
  219.                 the lowest index is chosen.
  220. Error handling  none
  221. Return value    minimum absolute value encountered.
  222. See also        VF_minind, VF_absmin, VF_runmin, VF_maxind, VCF_absminReIm
  223.  
  224.  
  225. ┌────────────────────────────────────────────────────────────────────────────┐
  226. │ VCF_absminReIm           VCD_absminReIm           VCE_absminReIm           │
  227. └────────────────────────────────────────────────────────────────────────────┘
  228. Function        Separate determination of the smallest absolute values of the
  229.                 real and imaginary parts occurring in a complex vector.
  230. Syntax          #include <VCFstd.h>
  231.                 fComplex  VCF_absminReIm( cfVector X, ui size );
  232.                       (similarly( VCD_, VCE_)
  233. Description     The absolute values of the real parts of all vector elements
  234.                 are compared with each other and the smallest one is returned
  235.                 as the real part of the result. Similarly, the absolute values
  236.                 of all the imaginary parts are compared with each other and
  237.                 the smallest one is returned as the imaginary part of the
  238.                 result. Generally, the result is made up from different
  239.                 elements of the vector.
  240. Error handling  none
  241. Return value    Smallest absolute real and imaginary parts, combined into one
  242.                 complex number.
  243. See also        VCF_minReIm, VCF_absmaxReIm
  244.  
  245.  
  246. ┌────────────────────────────────────────────────────────────────────────────┐
  247. │ VF_acos                  VD_acos                  VE_acos                  │
  248. │ VCF_acos                 VCD_acos                 VCE_acos                 │
  249. │ VFx_acos                 VDx_acos                 VEx_acos                 │
  250. │ VCFx_acos                VCDx_acos                VCEx_acos                │
  251. └────────────────────────────────────────────────────────────────────────────┘
  252. Function        arcus cosinus function
  253. Syntax          #include <VFmath.h>
  254.                 int  VF_acos(   fVector Y,  fVector X, ui size );
  255.                 int  VFx_acos(  fVector Y,  fVector  X, ui size,
  256.                                 float A, float B, float C );
  257. Description     normal versions:   Yi  =  arccos ( Xi )
  258.                 expanded versions: Yi  =  C *  arccos (A*Xi + B )
  259. Error handling  Real versions: DOMAIN errors occur for arguments outside the
  260.                 range    -1 <= Xi <= +1;  the default result is NAN ("not-a-
  261.                 number").
  262.                 The complex versions should be error-proof as long as the
  263.                 parameter C in the expanded versions is not already near the
  264.                 OVERFLOW limit; this very rare error is neither detected nor
  265.                 handled.
  266. Return value    0, if no error occurred, otherwise non-zero.
  267. See also        VF_cos,  VF_asin,  VF_atan,  acos
  268.  
  269.  
  270. ┌────────────────────────────────────────────────────────────────────────────┐
  271. │ VF_addC                  VD_addC                  VE_addC                  │
  272. │ VCF_addC                 VCD_addC                 VCE_addC                 │
  273. │ VCF_addReC               VCD_addReC               VCE_addReC               │
  274. │ VI_addC             VSI_addC            VLI_addC            VQI_addC       │
  275. │ VU_addC             VUS_addC            VUL_addC            VUI_addC       │
  276. └────────────────────────────────────────────────────────────────────────────┘
  277. Function        Add a constant to a vector
  278. Syntax          #include <VFmath.h>
  279.                 void VF_addC( fVector Y, fVector X, ui size, float C);
  280.                       (similarly VD_, VI_, etc.)
  281.                 void  VCF_addC( cfVector Y, cfVector X, ui size,
  282.                                 fComplex C );
  283.                 void  VCF_addReC( cfVector Y, cfVector X, ui size,
  284.                                   float CRe );
  285.                       (similarly VCD_, VCE_)
  286. Description     Yi  =  Xi  +  C
  287.                 The complex floating-point versions exist in two variants, one
  288.                 for complex constants C, the other for real-valued constants
  289.                 CRe added to the complex vector.
  290. Error handling  floating-point versions: none;
  291.                 integer versions: see chapter 5.2.
  292. Return value    none
  293. See also        VF_addV,  VF_subC,  VF_mulC,  VF_divC,  VF_visC,  VF_redC
  294.  
  295.  
  296. ┌────────────────────────────────────────────────────────────────────────────┐
  297. │ VF_addV                  VD_addV                  VE_addV                  │
  298. │ VCF_addV                 VCD_addV                 VCE_addV                 │
  299. │ VCF_addReV               VCD_addReV               VCE_addReV               │
  300. │ VFs_addV                 VDs_addV                 VEs_addV                 │
  301. │ VFx_addV                 VDx_addV                 VEx_addV                 │
  302. │ VCFx_addV                VCDx_addV                VCEx_addV                │
  303. │ VCFx_addReV              VCDx_addReV              VCEx_addReV              │
  304. │ VI_addV             VSI_addV            VLI_addV            VQI_addV       │
  305. │ VU_addV             VUS_addV            VUL_addV            VUI_addV       │
  306. └────────────────────────────────────────────────────────────────────────────┘
  307. Function        Add two vectors
  308. Syntax          #include <VFmath.h>
  309.                 void  VF_addV( fVector Z, fVector X, fVector Y,    ui size );
  310.                 void  VFs_addV( fVector Z, fVector X, fVector Y, ui size,
  311.                                 float C );
  312.                 void  VFx_addV( fVector Z, fVector X, fVector Y,
  313.                                 ui size, float A, float B );
  314.                       (similarly VD_,  VDx_,  VE_, VEx_,  VI_, etc.)
  315.                 void  VCF_addV( cfVector Z, cfVector X, cfVector Y,
  316.                                 ui size );
  317.                 void  VCF_addReV( cfVector Z, cfVector X, fVector Y,
  318.                                   ui size );
  319.                 void  VCFx_addV( cfVector Z, cfVector X, cfVector Y,
  320.                                  ui size, fComplex A, fComplex B );
  321.                 void  VCFx_addReV( cfVector Z, cfVector X, fVector Y,
  322.                                    ui size, fComplex A, fComplex B );
  323.                       (similarly VCD_,  VCDx_,  VCE_,  VCEx_)
  324. Description     normal versions:    Zi  =  Xi + Yi
  325.                 scaled versions:    Zi  =  C * (Xi + Yi)
  326.                 expanded versions:  Zi  =  (A * Xi + B)  +  Yi
  327.                 The complex floating-point versions exist in two variants. In
  328.                 the first variant (e.g.VCF_addV,  VCFx_addV), X, Y, and Z are
  329.                 all complex; in the second variant, Y is real-valued (e.g.,
  330.                 VCF_addReV - "add a real vector").
  331. Error handling  floating-point versions: none;
  332.                 integer versions: see chapter 5.2.
  333. Return value    none
  334. See also        VF_addC,  VF_subV,  VF_mulV,  VF_divV,  VF_visV,  VF_redV
  335.  
  336.  
  337. ┌────────────────────────────────────────────────────────────────────────────┐
  338. │ VI_and              VSI_and             VLI_and             VQI_and        │
  339. │ VU_and              VUS_and             VUL_and             VUI_and        │
  340. └────────────────────────────────────────────────────────────────────────────┘
  341. Function        Bit-wise AND operation.
  342. Syntax          #include <VImath.h>
  343.                 void VI_and( iVector Y, iVector X, ui size, int C );
  344.                       (similarly all other functions of this family)
  345. Description     Yi  =  (Xi) & C
  346.                 The bit-wise AND operation is performed on each element Xi
  347.                 with the bit-mask given by C.  A bit is 1 in Yi, if it was 1
  348.                 both in Xi and in C, and 0 otherwise. Perhaps the most useful
  349.                 application of this family of functions is the fast "modulo"
  350.                 operation on unsigned or positive numbers with the modulus
  351.                 being an integer power of 2. For example, a modulo division by
  352.                 64 is performed by
  353.                       VU_and( Y, X, size, 64-1 );
  354. Error handling  none
  355. Return value    none
  356. See also        VI_not,  VI_or,  VI_xor
  357.  
  358.  
  359. ┌────────────────────────────────────────────────────────────────────────────┐
  360. │ VCF_arg                  VCD_arg                  VCE_arg                  │
  361. └────────────────────────────────────────────────────────────────────────────┘
  362. Function        Argument (angle in polar coordinates). Implemented as a macro
  363.                 that calls VF_CtoArg, VD_CtoArg, VE_CtoArg, resp.  See these
  364.                 functions  for details.
  365.  
  366.  
  367. ┌────────────────────────────────────────────────────────────────────────────┐
  368. │ VF_asin                  VD_asin                  VE_asin                  │
  369. │ VCF_asin                 VCD_asin                 VCE_asin                 │
  370. │ VFx_asin                 VDx_asin                 VEx_asin                 │
  371. │ VCFx_asin                VCDx_asin                VCEx_asin                │
  372. └────────────────────────────────────────────────────────────────────────────┘
  373. Function        arcus sinus function
  374. Syntax          #include <VFmath.h>
  375.                 int  VF_asin( fVector Y, fVector X, ui size );
  376.                 int  VFx_asin( fVector  Y, fVector  X, ui size,
  377.                                float A, float B, float C );
  378. Description     normal versions:    Yi  =  arcsin ( Xi )
  379.                 expanded versions:  Yi  =  C *  arcsin (A*Xi + B )
  380. Error handling  Real versions: DOMAIN errors occur for arguments outside the
  381.                 range    -1 <= Xi <= +1;  the default result is NAN ("not-a-
  382.                 number").
  383.                 The complex versions should be error-proof as long as the
  384.                 parameter C in the expanded versions is not already near the
  385.                 OVERFLOW limit; this very rare error is either detected nor
  386.                 handled.
  387. Return value    0, if no error occurred, otherwise non-zero.
  388. See also        VF_sin,  VF_acos,  VF_atan,  asin
  389.  
  390.  
  391. ┌────────────────────────────────────────────────────────────────────────────┐
  392. │ VF_atan                  VD_atan                  VE_atan                  │
  393. │ VCF_atan                 VCD_atan                 VCE_atan                 │
  394. │ VFx_atan                 VDx_atan                 VEx_atan                 │
  395. │ VCFx_atan                VCDx_atan                VCEx_atan                │
  396. └────────────────────────────────────────────────────────────────────────────┘
  397. Function        arcus tangens function
  398. Syntax          #include <VFmath.h>
  399.                 int  VF_atan(  fVector Y, fVector X, ui size );
  400.                 int  VFx_atan( fVector Y, fVector X, ui size,
  401.                                float A, float B, float C );
  402. Description     normal versions:    Yi  =  arctan ( Xi )
  403.                 expanded versions:  Yi  =  C *  arctan (A*Xi + B )
  404. Error handling  The real versions should be error-proof as long as the
  405.                 parameter C in the expanded versions is not already near the
  406.                 OVERFLOW limit; this very rare error is neither detected nor
  407.                 handled.
  408.                 In the complex versions, the result for an argument of {0, -1}
  409.                 is set to   {0, -Pi} without notice (and without the program
  410.                 crash resulting in Borland C++ from calling the complex atan
  411.                 with this argument).
  412. Return value    always 0.
  413. See also        VF_tan,  VF_asin,  VF_acos,  VF_atan2,  atan,  atan2
  414.  
  415.  
  416. ┌────────────────────────────────────────────────────────────────────────────┐
  417. │ VF_atan2                 VD_atan2                 VE_atan2                 │
  418. │ VFx_atan2                VDx_atan2                VEx_atan2                │
  419. └────────────────────────────────────────────────────────────────────────────┘
  420. Function        arcus tangens function of quotients
  421. Syntax          #include <VFmath.h>
  422.                 int VF_atan2( fVector Z, fVector X, fVector Y, ui size );
  423.                 int  VFx_atan2( fVector Z,  fVector X,  fVector Y, ui size,
  424.                                 float A, float B, float C );
  425. Description     normal versions:    Zi  =  arctan(  Yi / Xi )
  426.                 expanded versions:  Zi  =  C *  arctan(  Yi / (A*Xi+B) )
  427.                 From Cartesian X - Y- coordinates, the angle of the
  428.                 corresponding polar coordinates is calculated. Be careful: in
  429.                 comparison to the ANSI C function atan2, the ordering of the
  430.                 parameters X and Y is reversed.
  431. Error handling  If Xi  and Yi are both zero, a DOMAIN error results with the
  432.                 default result NAN ("not-a-number"); this error is handled by
  433.                 _matherr and _matherrl  with Xi  and Yi as e->x and e->y.
  434. Return value    0, if no error occurred, otherwise non-zero.
  435. See also        VF_tan,  VF_asin,  VF_acos,  VF_atan,  atan,  atan2
  436.  
  437.  
  438. ┌────────────────────────────────────────────────────────────────────────────┐
  439. │ VF_autocorr              VD_autocorr              VE_autocorr              │
  440. └────────────────────────────────────────────────────────────────────────────┘
  441. Function        autocorrelation function
  442. Syntax          #include <VFstd.h>
  443.                 void VF_autocorr(  fVector Y, fVector X, ui size );
  444. Description     The autocorrelation function (ACF) of X is calculated and
  445.                 stored in Y  in wrap-around order: Y[0] to Y[size/2-1]
  446.                 contain the ACF for zero and positive lags. Beginning with
  447.                 the most negative lag in Y[size/2+1], the elements up to
  448.                 Y[size-1] contain the ACF for negative lags. Since this
  449.                 function assumes X to be periodic, the ACF for the most
  450.                 positive lag is identical to the ACF for the most negative
  451.                 lag. This element is stored as Y[size/2].
  452.                 To get the ACF into normal order, you may call
  453.                    VF_rotate( Y, Y, size, size/2 );
  454.                 After that, the zero point is at the position size/2.
  455.  
  456.                 In case X is non-periodic, you should avoid end effects
  457.                 by the methods described in connection with VF_convolve.
  458.  
  459.                 About special versions with the prefixes  VFs_  and VFl_,
  460.                 consult chapter 4.8.
  461. Error handling  If size is not a power of 2,  VF_FFT  (on which VF_autocorr
  462.                 is based) complains "Size must be an integer power of 2"
  463.                 and the program is aborted.
  464. Return value    none
  465. See also        VF_FFT,  VF_convolve,  VF_xcorr, VF_spectrum
  466.  
  467.  
  468. ┌────────────────────────────────────────────────────────────────────────────┐
  469. │ VCF_autoPlot             VCD_autoPlot             VCE_autoPlot             │
  470. └────────────────────────────────────────────────────────────────────────────┘
  471. Function        Automatic plot of a complex vector into a Cartesian complex
  472.                 plane.
  473. Syntax          #include <Vgraph.h>
  474.                 void VCF_autoPlot( cfVector X, ui size,
  475.                                    unsigned form, COLORREF color );
  476. Description     A Cartesian complex plane is drawn with the axes automatically
  477.                 scaled and the vector X plotted into it. For a description of
  478.                 the parameters form and color, see VF_xyAutoPlot. The plotting
  479.                 routines have to be initialized by V_initGraph or V_initPlot
  480.                 prior to calling VCF_autoPlot.
  481. Error handling  none
  482. Return value    none
  483. See also        VCF_2AutoPlot,  VCF_dataPlot, VF_xyAutoPlot,  chapter 4.11
  484.  
  485.  
  486. ┌────────────────────────────────────────────────────────────────────────────┐
  487. │ VCF_2AutoPlot            VCD_2AutoPlot            VCE_2AutoPlot            │
  488. └────────────────────────────────────────────────────────────────────────────┘
  489. Function        Automatic plot of two complex vectors into a Cartesian
  490.                 complex plane.
  491. Syntax          #include <Vgraph.h>
  492.                 void VCF_2AutoPlot(  cfVector X1, ui size1,
  493.                                      unsigned form1, COLORREF color1,
  494.                                      cfVector X2, ui size2,
  495.                                      unsigned form2, COLORREF color2 );
  496. Description     A Cartesian complex plane is drawn with the axes automatically
  497.                 scaled and the vectors X1 and X2 plotted into it. For a
  498.                 description of the parameters form1, form2, color1, and
  499.                 color2, see VF_xyAutoPlot. The plotting routines have to be
  500.                 initialized by V_initGraph or V_initPlot prior to calling
  501.                 VCF_2AutoPlot.
  502. Error handling  none
  503. Return value    none
  504. See also        VCF_autoPlot,  VCF_dataPlot, VF_xyAutoPlot,  chapter 4.11
  505.  
  506.  
  507. ┌────────────────────────────────────────────────────────────────────────────┐
  508. │ VF_avdevC                VD_avdevC                VE_avdevC                │
  509. └────────────────────────────────────────────────────────────────────────────┘
  510. Function        average deviation from a preset value
  511. Syntax          #include <VFstd.h>
  512.                 float  VF_avdevC( fVector X, ui size, float C );
  513. Description     avdevC  =  1/size * sum(  │Xi - C│ )
  514.                 The average of the absolute deviation of each element of X
  515.                 from C is calculated and returned.
  516. Error handling  none
  517. Return value    average deviation.
  518. See also        VF_ssq, VF_ssqdevC, VF_avdevV, VF_sumdevC, VF_chiabs
  519.  
  520.  
  521. ┌────────────────────────────────────────────────────────────────────────────┐
  522. │ VF_avdevV                VD_avdevV                VE_avdevV                │
  523. └────────────────────────────────────────────────────────────────────────────┘
  524. Function        average deviation of the elements of one vector from the
  525.                 corresponding elements of another vector.
  526. Syntax          #include <VFstd.h>
  527.                 float  VF_avdevV( fVector X, fVector Y, ui size );
  528. Description     avdevV  =  1/size * sum(  │Xi - Yi│ )
  529.                 The average of the absolute deviation of each element of X
  530.                 from the corresponding element of Y is calculated.
  531. Error handling  none
  532. Return value    average deviation.
  533. See also        VF_ssq, VF_ssqdevV, VF_avdevC, VF_sumdevV, VF_chiabs
  534.  
  535.  
  536. ┌────────────────────────────────────────────────────────────────────────────┐
  537. │ V_CDtoCF                 V_CDtoCE                                          │
  538. │ V_CEtoCF                 V_CEtoCD                                          │
  539. │ V_CFtoCD                 V_CFtoCE                                          │
  540. └────────────────────────────────────────────────────────────────────────────┘
  541. Function        Data type conversions.  See V_FtoD.
  542.  
  543.  
  544. ┌────────────────────────────────────────────────────────────────────────────┐
  545. │ VF_ceil                  VD_ceil                  VE_ceil                  │
  546. │ VF_ceiltoI               VD_ceiltoI               VE_ceiltoI               │
  547. │ VF_ceiltoSI              VD_ceiltoSI              VE_ceiltoSI              │
  548. │ VF_ceiltoLI              VD_ceiltoLI              VE_ceiltoLI              │
  549. │ VF_ceiltoQI              VD_ceiltoQI              VE_ceiltoQI              │
  550. │ VF_ceiltoU               VD_ceiltoU               VE_ceiltoU               │
  551. │ VF_ceiltoUS              VD_ceiltoUS              VE_ceiltoUS              │
  552. │ VF_ceiltoUL              VD_ceiltoUL              VE_ceiltoUL              │
  553. │ VF_ceiltoUI              VD_ceiltoUI              VE_ceiltoUI              │
  554. └────────────────────────────────────────────────────────────────────────────┘
  555. Function        Rounding to the next whole number that is greater or equal.
  556. Syntax          #include <VFmath.h>
  557.                 int VF_ceil(    fVector Y,  fVector X,  ui size );
  558.                 int VF_ceiltoI( iVector Y,  fVector X,  ui size );
  559.                 int VF_ceiltoLI( liVector Y, fVector X, ui size );
  560.                      (similarly  all other functions of this family)
  561. Description     Each element of X is rounded to the nearest whole number that
  562.                 is greater than or equal to the input number and the result
  563.                 stored in Y. The functions VF_ceiltoI, VF_ceiltoLI,
  564.                 VF_ceiltoU etc. convert the result into the various integer
  565.                 data types (in the cases mentioned, to int,  long int, and
  566.                 unsigned, resp.).
  567. Error handling  OVERFLOW errors are handled by setting the result to the
  568.                 extreme value possible. Negative numbers in the versions
  569.                 VF_ceiltoU, VF_ceiltoUS, VF_ceiltoUL, and VF_ceiltoUI  lead
  570.                 to DOMAIN errors; they are handled by setting the result to 0.
  571. Return value    0, if no error occurred, otherwise non-zero.
  572. See also        ceil, floor, VF_round,  VF_floor, VF_chop, VF_trunc
  573.  
  574.  
  575. ┌────────────────────────────────────────────────────────────────────────────┐
  576. │ VF_chiabs                VD_chiabs                VE_chiabs                │
  577. └────────────────────────────────────────────────────────────────────────────┘
  578. Function        Absolute-value analogue of the chi-square merit function.
  579. Syntax          #include <VFstd.h>
  580.                 float  VF_chiabs( fVector X,  fVector Y,
  581.                                   fVector Wt, ui size );
  582. Description     chiabs  =  sum( weighti * |Xi - Yi| ).
  583.                 The chiabs function is a "robust" replacement for the
  584.                 chi-square merit function. It is used to judge the quality
  585.                 of a fit in the presence of outlier points. The chiabs
  586.                 function is disturbed by outlier points to a lesser degree
  587.                 than the chi-square function. 
  588. Error handling  none
  589. Return value    chiabs merit function.
  590. See also        VF_chi2
  591.  
  592.  
  593. ┌────────────────────────────────────────────────────────────────────────────┐
  594. │ VF_chi2                  VD_chi2                  VE_chi2                  │
  595. └────────────────────────────────────────────────────────────────────────────┘
  596. Function        Chi-square merit function.
  597. Syntax          #include <VFstd.h>
  598.                 float  VF_chi2(  fVector X,  fVector Y,
  599.                                  fVector InvVar, ui size );
  600. Description     chi²  =  sum( 1/sigmai² * (Xi - Yi)² ).
  601.                 The chi-square merit function is most often used to judge the
  602.                 quality of a fit. One vector (either X or Y) represents
  603.                 experimental values that are obtained with individual standard
  604.                 deviations sigmai, the other contains the values predicted on
  605.                 the basis of a theory or a model. If the experimental data are
  606.                 "normally" distributed, and if sigma is the correct measure
  607.                 for the quality of these data, then chi² is a measure for the
  608.                 quality of the fit. Rather than the standard deviations
  609.                 themselves, the routine needs the inverse of their squares
  610.                 (i.e., the inverse of the variances) to be passed as the
  611.                 vector InvVar.
  612. Error handling  none
  613. Return value    chi² merit function.
  614. See also        VF_meanwW,  VF_varianceVwW, VF_varianceV, VF_varianceCwW,
  615.                 VF_chiabs, VF_square, VF_inv, VF_linregress
  616.  
  617.  
  618. ┌────────────────────────────────────────────────────────────────────────────┐
  619. │ VF_chop                  VD_chop                  VE_chop                  │
  620. │ VF_choptoI               VD_choptoI               VE_choptoI               │
  621. │ VF_choptoSI              VD_choptoSI              VE_choptoSI              │
  622. │ VF_choptoLI              VD_choptoLI              VE_choptoLI              │
  623. │ VF_choptoQI              VD_choptoQI              VE_choptoQI              │
  624. │ VF_choptoU               VD_choptoU               VE_choptoU               │
  625. │ VF_choptoUS              VD_choptoUS              VE_choptoUS              │
  626. │ VF_choptoUL              VD_choptoUL              VE_choptoUL              │
  627. │ VF_choptoUI              VD_choptoUI              VE_choptoUI              │
  628. └────────────────────────────────────────────────────────────────────────────┘
  629. Function        "Chopping" towards zero.
  630. Syntax          #include <VFmath.h>
  631.                 int VF_chop(     fVector Y,  fVector X, ui size );
  632.                 int VF_choptoI(  iVector Y,  fVector X, ui size );
  633.                 int VF_choptoLI( liVector Y, fVector X, ui size );
  634.                      (similarly  all other functions of this family)
  635. Description     Each element of X is rounded to an integer number by "chopping
  636.                 off" the fractional part. For example, -3.9 yields -3, and
  637.                 +3.9 yields +3. The result is stored in Y. The functions
  638.                 VF_choptoI, VF_choptoLI, etc. convert the result into the
  639.                 various integer data types.
  640. Error handling  OVERFLOW errors are handled by setting the result to the
  641.                 extreme value possible. Negative numbers in the versions
  642.                 VF_choptoU, VF_choptoUS, VF_choptoUL, and VF_choptoUI  lead
  643.                 to DOMAIN errors; they are handled by setting the result to 0.
  644. Return value    0, if no error occurred, otherwise non-zero.
  645. See also        ceil, floor, VF_round,  VF_floor, VF_ceil
  646.  
  647.  
  648. ┌────────────────────────────────────────────────────────────────────────────┐
  649. │ V_closeErrorEventFile                                                      │
  650. └────────────────────────────────────────────────────────────────────────────┘
  651. Function        Restore default printing of error messages into stderr.
  652. Syntax          #include <VecLib.h>
  653.                 void  V_closeErrorEventFile( void );
  654. Description     After error messages have been redirected into an event file
  655.                 by V_setErrorEventFile, the default is restored by
  656.                 V_closeErrorEventFile and any further messages will be printed
  657.                 into stderr  which normally is the screen (see Chapter 5.5).
  658.                 Both of thess functions will not be included in versions of
  659.                 VectorLib for compilers that do already offer the possibility
  660.                 of printing error messages simultaneously to the screen and to
  661.                 an event file.
  662. Error handling  none
  663. Return value    none
  664. See also        V_noteError,  V_setErrorEventFile,  _matherr
  665.  
  666.  
  667. ┌────────────────────────────────────────────────────────────────────────────┐
  668. │ VF_cmp0                  VD_cmp0                  VE_cmp0                  │
  669. └────────────────────────────────────────────────────────────────────────────┘
  670. Function        Compares each element of a vector with 0 (signum function).
  671. Syntax          #include <VFmath.h>
  672.                 void VF_cmp0( fVector Y,  fVector X, ui size );
  673. Description     Each element of X is compared with 0 and the result of the
  674.                 comparison stored in Y:
  675.                     Yi =   1.0,   if  Xi > 0
  676.                     Yi =   0.0,   if  Xi = 0
  677.                     Yi =  -1.0,   if  Xi < 0.
  678.                 This function may also be called under its synonym VF_sgn.
  679. Error handling  none
  680. Return value    none
  681. See also        VF_cmp_..., VF_cmpC, VF_cmpV
  682.  
  683.  
  684. ┌────────────────────────────────────────────────────────────────────────────┐
  685. │ VF_cmpC                  VD_cmpC                  VE_cmpC                  │
  686. └────────────────────────────────────────────────────────────────────────────┘
  687. Function        Compares each element of a vector with a constant.
  688. Syntax          #include <VFmath.h>
  689.                 void VF_cmpC( fVector Y, fVector X, ui size, float C );
  690. Description     Each element of X is compared with C and the result of the
  691.                 comparison stored in Y:
  692.                      Yi =   1.0,   if  Xi > C
  693.                      Yi =   0.0,   if  Xi = C
  694.                      Yi =  -1.0,   if  Xi < C
  695.                 To compare with C=0, use more efficiently the function VF_cmp0.
  696. Error handling  none
  697. Return value    none
  698. See also        VF_cmp_..., VF_cmp0, VF_cmpV,  VF_iselementC
  699.  
  700.  
  701. ┌────────────────────────────────────────────────────────────────────────────┐
  702. │ VF_cmpV                  VD_cmpV                  VE_cmpV                  │
  703. └────────────────────────────────────────────────────────────────────────────┘
  704. Function        Compares each element of a vector with the corresponding
  705.                 element of another vector.
  706. Syntax          #include <VFmath.h>
  707.                 void VF_cmpV( fVector Z, fVector X, fVector Y, ui size );
  708. Description     Each element of X is compared with the corresponding element
  709.                 of Y and the result of the comparison stored in Z:
  710.                      Zi =   1.0,   if  Xi > Yi
  711.                      Zi =   0.0,   if  Xi = Yi
  712.                      Zi =  -1.0,   if  Xi < Yi.
  713. Error handling  none
  714. Return value    none
  715. See also        VF_cmp_..., VF_cmp0, VF_cmpV
  716.  
  717.  
  718. ┌────────────────────────────────────────────────────────────────────────────┐
  719. │ VF_cmp_...               VD_cmp_...               VE_cmp_...               │
  720. │ VCF_cmp_...              VCD_cmp_...              VCE_cmp_...              │
  721. └────────────────────────────────────────────────────────────────────────────┘
  722. Function        Comparisons
  723. Syntax          #include <VFmath.h>
  724.                 ui VF_cmp_eq0(  fVector Y,  fVector X,  ui size );
  725.                 ui VF_cmp_ne0(  fVector Y,  fVector X,  ui size );
  726.                 ui VF_cmp_gt0(  fVector Y,  fVector X,  ui size );
  727.                 ui VF_cmp_ge0(  fVector Y,  fVector X,  ui size );
  728.                 ui VF_cmp_lt0(  fVector Y,  fVector X , ui size );
  729.                 ui VF_cmp_le0(  fVector Y,  fVector X,  ui size );
  730.                 ui VF_cmp_eqC( fVector Y, fVector X, ui size, float C );
  731.                    ... (similarly: VF_cmp_neC,  VF_cmp_gtC, VF_cmp_geC,
  732.                                    VF_cmp_ltC, VF_cmp_leC)
  733.                 ui VF_cmp_eqV( fVector Z, fVector X, fVector Y, ui size);
  734.                    ... (similarly: VF_cmp_neV, VF_cmp_gtV, VF_cmp_geV,
  735.                                    VF_cmp_ltV, VF_cmp_leV)
  736.                 ui VF_cmp_eq0ind( uiVector Ind, fVector X, ui size );
  737.                    ... (similarly: VF_cmp_ne0ind,  VF_cmp_gt0ind,
  738.                                    VF_cmp_ge0ind,  VF_cmp_lt0ind,
  739.                                    VF_cmp_le0ind)
  740.                 ui VF_cmp_eqCind( uiVector Ind, fVector X, ui size,
  741.                                   float C );
  742.                    ...  (similarly: VF_cmp_neCind,  VF_cmp_gtCind,
  743.                                     VF_cmp_geCind,  VF_cmp_ltCind,
  744.                                     VF_cmp_leCind)
  745.                 ui VF_cmp_eqVind( uiVector Ind, fVector X, fVector Y,
  746.                                   ui size );
  747.                    ...  (similarly: VF_cmp_neVind,  VF_cmp_gtVind,
  748.                                     VF_cmp_geVind,  VF_cmp_ltVind,
  749.                                     VF_cmp_leVind)
  750.                    (similarly VD_ and VE_ versions)
  751.  
  752.                 ui VCF_cmp_eq0( cfVector Y, cfVector X,  ui size );
  753.                 ui VCF_cmp_ne0( cfVector Y, cfVector X,  ui size );
  754.                 ui VCF_cmp_eqC( cfVector Y, cfVector X,  ui size,
  755.                                 fComplex C );
  756.                 ui VCF_cmp_neC( cfVector Y, cfVector X,  ui size,
  757.                                 fComplex C );
  758.                 ui VCF_cmp_eqV( cfVector Z, cfVector X, cfVector Y,
  759.                                 ui size );
  760.                 ui VCF_cmp_neV( cfVector Z, cfVector X, cfVector Y,
  761.                                 ui size );
  762.                 ui VCF_cmp_eq0ind( uiVector Ind, cfVector X, ui size );
  763.                 ui VCF_cmp_ne0ind( uiVector Ind, cfVector X, ui size );
  764.                 ui VCF_cmp_eqCind( uiVector Ind, cfVector X, ui size,
  765.                                    fComplex C );
  766.                 ui VCF_cmp_neCind( uiVector Ind, cfVector X, ui size,
  767.                                    fComplex C );
  768.                 ui VCF_cmp_eqVind( uiVector Ind, cfVector X,
  769.                                    cfVector Y, ui size );
  770.                 ui VCF_cmp_neVind( uiVector Ind, cfVector X,
  771.                                    cfVector Y, ui size );
  772.                    (similarly VCD_ and  VCE_ versions)
  773. Description     Each element of X is compared with either 0, or a constant C,
  774.                 or the corresponding element of another vector, Y. The
  775.                 conditions to be tested are denoted by two letters as in
  776.                 ASSEMBLER or FORTRAN:
  777.                 "eq"  ("equal"):            True, if  Xi  = 0  (C, Yi, resp.)
  778.                 "ne"  ("not equal"):        True, if  Xi != 0  (C, Yi, resp.)
  779.                 "gt"  ("gteater than"):     True, if  Xi  > 0  (C, Yi, resp.)
  780.                 "ge"  ("greater or equal"): True, if  Xi >= 0  (C, Yi, resp.)
  781.                 "lt"  ("less than"):        True, if  Xi  < 0  (C, Yi, resp.)
  782.                 "le"  ("less or equal"):    True, if  Xi <= 0  (C, Yi, resp.).
  783.  
  784.                 For complex numbers, only the testing for equality ("eq") or
  785.                 inequality ("ne") makes sense and is available.
  786.  
  787.                 There are two different ways how the result of the comparison
  788.                 is treated. The result for each element of X is either stored
  789.                 as 1.0 for TRUE and 0.0 for FALSE in a vector of a floating-
  790.                 point data type (with the imaginary part in the complex
  791.                 versions always set to 0), or the indices of the elements for
  792.                 which the result is TRUE are stored in an index vector; the
  793.                 latter is the case in the functions with the suffix "ind" as
  794.                 the last part of their names, like in VF_cmp_neCind. In any
  795.                 case, the number of TRUE results encountered is returned by
  796.                 the function. The index-finding variant is especially useful
  797.                 to extract the elements for which the condition is TRUE into a
  798.                 sub-vector by VF_indpick; be sure to check that the return
  799.                 value nTrue is non-zero if you wish to do that (remember that
  800.                 the parameter size for any of the functions of this VectorLib
  801.                 library must be non-zero!).
  802. Error handling  none
  803. Return value    number of elements for which the condition was found to be
  804.                 TRUE.
  805. See also        VF_cmp0, VF_cmpC, VF_cmpV, VF_indpick, VF_iselementC
  806.  
  807.  
  808. ┌────────────────────────────────────────────────────────────────────────────┐
  809. │ VF_comb                  VD_comb                  VE_comb                  │
  810. └────────────────────────────────────────────────────────────────────────────┘
  811. Function        Initializes a vector with a comb function.
  812. Syntax          #include <VFstd.h>
  813.                 void VF_comb( fVector X, ui size, ui spac, float C );
  814. Description     Xi  = C,     i = 0,  1*spac,  2*spac,...
  815.                 Xi  = 0,     otherwise
  816. Error handling  If the spacing spac of the comb exceeds size, an error message
  817.                 "Invalid parameter(s)" is displayed and the program aborted.
  818. Return value    none
  819. See also        VF_equ1, VF_equ0, VF_equC
  820.  
  821.  
  822. ┌────────────────────────────────────────────────────────────────────────────┐
  823. │ VCF_complex              VCD_complex              VCE_complex              │
  824. └────────────────────────────────────────────────────────────────────────────┘
  825. Function        Constructs a Cartesian complex vector from its real and
  826.                 imaginary parts. Implemented as a macro that calls VF_ReImtoC,
  827.                 VD_ReImtoC, VE_ReImtoC, resp.  See these functions for details.
  828.  
  829.  
  830. ┌────────────────────────────────────────────────────────────────────────────┐
  831. │ VCF_conj                 VCD_conj                VCE_conj                  │
  832. └────────────────────────────────────────────────────────────────────────────┘
  833. Function        Find the complex conjugate of a vector.
  834. Syntax          #include <VCFmath.h>
  835.                 int  VCF_conj(  cfVector Y,  cfVector X,  ui size );
  836. Description     Re(Yi)  =   Re(Xi)
  837.                 Im(Yi)  =  -Im(Xi)
  838. Error handling  none
  839. Return value    always 0
  840. See also        VCF_neg,  VF_abs
  841.  
  842.  
  843. ┌────────────────────────────────────────────────────────────────────────────┐
  844. │ V_continuePlot                                                             │
  845. └────────────────────────────────────────────────────────────────────────────┘
  846. Function        Get back into the last viewport used for plotting
  847. Syntax          #include <Vgraph.h>
  848.                 void V_continuePlot( void );
  849. Description     If one wants to add new DataPlots to an existing coordinate
  850.                 system after one has already defined a new viewport (e.g.,
  851.                 for text output), this function takes one back to the most
  852.                 recently used coordinate system.
  853. Error handling  none
  854. Return value    none
  855. See also        V_getCoordSystem, V_setCoordSystem, V_setPlotRegion
  856.  
  857.  
  858. ┌────────────────────────────────────────────────────────────────────────────┐
  859. │ VF_convolve              VD_convolve              VE_convolve              │
  860. └────────────────────────────────────────────────────────────────────────────┘
  861. Function        Calculates the convolution of a vector with a response
  862.                 function.
  863. Syntax          #include <VFstd.h>
  864.                 void VF_convolve( fVector Y, fVector Flt, fVector X,
  865.                                   fVector Rsp, ui size );
  866. Description     The convolution of X with the response function Rsp is
  867.                 calculated and stored in Y.  A filter Flt is also calculated.
  868.                 If more than one vector is to be convolved with the same Rsp,
  869.                 use VF_convolve only once and use VF_filter for the other
  870.                 vectors.
  871.                 The response has to be stored in Rsp in wrap-around order:
  872.                 the response for zero and positive times (or whatever the
  873.                 independent variable is) is stored in Rsp[0]  to Rsp[size/2]
  874.                 and the response for negative times (beginning with the most
  875.                 negative time) in Rsp[size/2+1] to Rsp[size-1].  You may wish
  876.                 to use VF_rotate or VF_reflect to achieve this wrap-around
  877.                 order and to construct the response vector.
  878.                 Notice that Rsp has to be of the same size as X.
  879.  
  880.                 The result of the convolution appears scaled with the sum
  881.                 of all elements of Rsp. Normally, therefore, Rsp should be
  882.                 normalized to 1.0.
  883.  
  884.                 X, Y, Rsp, and Flt must all be of the same size, which has to
  885.                 be an integer power of 2.  X may be overwritten by Y, Rsp may
  886.                 be overwritten by Flt, but X and Flt as well as Y and Rsp
  887.                 have to be distinct from each other.
  888.  
  889.                 The treatment of round-off errors in the construction of
  890.                 Flt may be modified by VF_setRspEdit.
  891.  
  892. Example         VF_ramp(  Time,  1024, 0.0, 1.0 );
  893.                 VF_Gauss( Rsp, Time, 513, 10.0, 0.0, 1.0 );
  894.                       /* Response function for zero and positive times */
  895.                 VF_reflect( Rsp+1, 1023 );
  896.                       /* ... and for negative times  */
  897.                 VF_divC( Rsp, Rsp, 1024, VF_sum( Rsp, 1024 ) );
  898.                       /*  Normalisation of Rsp */
  899.                 VF_convolve(  X, Rsp, X, Rsp, 1024 );
  900.                       /* Convolution;  X is overwritten by the desired result
  901.                          and Rsp is overwritten by the frequency filter    */
  902.                 VF_filter( Y, Y, Rsp, 1024 );
  903.                       /* Next convolution: instead of another call to
  904.                          VF_convolve,  Y is filtered using the frequency
  905.                          filter just obtained                            */
  906.  
  907.                 Mathematically, this convolution is based on the assumption
  908.                 that X is periodic; it still works well if X is non-periodic
  909.                 but converges on both ends to the same value X[0] = X[size-1].
  910.                 If that is not the case, the first and the last elements of Y
  911.                 are spoiled by "wrap-around" from elements on the other side.
  912.                 Extrapolate X on both sides in order to imbed the original X
  913.                 in a larger vector, if wrap-around is a problem. The minimum
  914.                 number of elements to be added equals half the width of the
  915.                 response function. (In the case of an asymmetric response
  916.                 function, it is the broader wing that counts.) After con-
  917.                 volving the larger vector with the response function, it
  918.                 will be the dummy elements just added which become spoiled
  919.                 by wrap-around. Those elements of the result vector which
  920.                 correspond to the original X will represent the desired
  921.                 convolution of X with Rsp.
  922.                 If X is smoothly converging on both sides to different values,
  923.                 it is not necessary to employ the procedure just described.
  924.                 Rather, the difference between the end points may be regarded
  925.                 as a linear trend. In this case, remove the trend, convolve
  926.                 the resultant vector and add the trend to the result.
  927.  
  928. Example         d = (X[size-1] - X[0]) / (size-1);
  929.                 VF_ramp( Trend, size, 0.0, d );
  930.                 VF_subV( Y, X, Trend, size );
  931.                 VF_convolve( Y, Flt, Y, Rsp, size );
  932.                 VF_addV( Y, Y, Trend, size );
  933.  
  934.                 You might notice that Flt is declared as fVector rather than
  935.                 cfVector,  although the information stored in Flt consists of
  936.                 complex numbers. The reason is that these numbers are stored
  937.                 in the packed complex format (as described for VF_FFT) which
  938.                 is used only in connection with Fourier-Transform operations
  939.                 of real vectors.
  940.  
  941.                 About special versions with the prefixes  VFs_  and VFl_,
  942.                 consult chapter 4.8.
  943. Error handling  If size is not a power of 2,  VF_FFT  (on which VF_convolve
  944.                 is based) complains "Size must be an integer power of 2"
  945.                 and the program is aborted.
  946. Return value    none
  947. See also        VF_filter,  VF_deconvolve, VF_FFT,  VF_autocorr, VF_xcorr,
  948.                 VF_spectrum
  949.  
  950.  
  951. ┌────────────────────────────────────────────────────────────────────────────┐
  952. │ VF_corrcoeff             VD_corrcoeff             VE_corrcoeff             │
  953. └────────────────────────────────────────────────────────────────────────────┘
  954. Function        Linear correlation coefficient between two distributions
  955. Syntax          #include <VFstd.h>
  956.                 float VF_corrcoeff( fVector X, fVector Y, ui size,
  957.                                     float Xmean, float Ymean );
  958. Description     The linear correlation coefficient ("Pearson's r") takes on
  959.                 values between -1.0 and +1.0.  The mean values of both
  960.                 distributions must be known. They are passed to VF_corrcoeff
  961.                 as the parameters Xmean and Ymean.
  962. Example         r = VF_corrcoeff(  X,  Y,  n,  VF_mean( X, n ),
  963.                                                VF_mean( Y, n ) );
  964. Error handling  none
  965. Return value    linear correlation coefficient r
  966. See also        VF_mean,  VF_varianceV,  VF_linregress
  967.  
  968.  
  969. ┌────────────────────────────────────────────────────────────────────────────┐
  970. │ VF_cos                   VD_cos                   VE_cos                   │
  971. │ VCF_cos                  VCD_cos                  VCE_cos                  │
  972. │ VFx_cos                  VDx_cos                  VEx_cos                  │
  973. │ VCFx_cos                 VCDx_cos                 VCEx_cos                 │
  974. └────────────────────────────────────────────────────────────────────────────┘
  975. Function        Cosine function
  976. Syntax          #include <VFmath.h>
  977.                 int  VF_cos(   fVector  Y,  fVector  X, ui size );
  978.                 int  VFx_cos(  fVector  Y,  fVector  X, ui size,
  979.                                float A, float B, float C );
  980. Beschreibung    normal versions:     Yi  =  cos ( Xi )
  981.                 expanded versions:   Yi  =  C *  cos (A*Xi + B )
  982.                 For large values of Xi, round-off error becomes appreciable;
  983.                 if the Xi values are representable as rational multiples of Pi,
  984.                 it is better to use  VF_cosrpi  than VF_cos.
  985. Error handling  Precision errors in the real-value functions lead to a default
  986.                 result of 1.0 (as if the input were 0.0) and to a non-zero
  987.                 return value, but are otherwise ignored; _matherr is not
  988.                 called.
  989.                 OVERFLOW errors can only occur in the complex versions and
  990.                 lead to a result of ±HUGE_VAL.
  991. Return value    0, if no error occurred, otherwise non-zero.
  992. See also        VF_cos2,  VF_cosrpi,  VF_sin,  VF_cosh,  VF_acos,  cos
  993.  
  994.  
  995. ┌────────────────────────────────────────────────────────────────────────────┐
  996. │ VF_cos2                  VD_cos2                  VE_cos2                  │
  997. │ VFx_cos2                 VDx_cos2                 VEx_cos2                 │
  998. └────────────────────────────────────────────────────────────────────────────┘
  999. Function        Square of the cosine function
  1000. Syntax          #include <VFmath.h>
  1001.                 int  VF_cos2(  fVector  Y,  fVector  X, ui size );
  1002.                 int  VFx_cos2( fVector  Y,  fVector  X, ui size,
  1003.                                float A, float B, float C );
  1004. Description     normal versions:    Yi  =  cos²( Xi )
  1005.                 expanded versions:  Yi  =  C *  cos²(A*Xi + B )
  1006.                 Calculating the squared trigonometric functions directly is
  1007.                 faster and sometimes more accurate than first calculating the
  1008.                 trigonometric function itself and squaring it afterwards.
  1009. Error handling  Precision errors lead to a default result of 1.0 (as if the
  1010.                 input were 0.0) and a non-zero return value, but are otherwise
  1011.                 ignored; _matherr is not called.
  1012.                 OVERFLOW errors can only occur in the complex versions and
  1013.                 lead to a result of ±HUGE_VAL.
  1014. Return value    0, if no error occurred, otherwise non-zero.
  1015. See also        VF_cos,   VF_cosrpi,   cos
  1016.  
  1017.  
  1018. ┌────────────────────────────────────────────────────────────────────────────┐
  1019. │ VF_cosec                 VD_cosec                 VE_cosec                 │
  1020. │ VFx_cosec                VDx_cosec                VEx_cosec                │
  1021. └────────────────────────────────────────────────────────────────────────────┘
  1022. Function        Cosecant function
  1023. Syntax          #include <VFmath.h>
  1024.                 int  VF_cosec(  fVector  Y,  fVector  X, ui size );
  1025.                 int  VFx_cosec( fVector  Y,  fVector  X, ui size,
  1026.                                 float A, float B, float C );
  1027. Description     normal versions:     Yi =  cosec ( Xi )   =  1.0 / sin ( Xi )
  1028.                 expanded versions:   Yi =  C * cosec ( A*Xi + B )
  1029.                 The cosecant is defined as the inverse of the sine (not to be
  1030.                 mistaken for the arcus function arcsin!) For large values of
  1031.                 Xi, round-off error becomes appreciable; if the Xi values are
  1032.                 representable as rational multiples of Pi, it is better to use
  1033.                 VF_cosecrpi  than VF_cosec.
  1034. Error handling  For TLOSS precision errors, the default result is arbitrarily
  1035.                 set to 1.0 (as an exception from the general rule which would
  1036.                 require the result to be the mean of the results for +0 and -0.
  1037.                 This would be 0.0. However, zero is not a valid result for the
  1038.                 cosecant function). For SING and OVERFLOW errors, the default
  1039.                 result is ±HUGE_VAL.
  1040. Return value    0, if no error occurred, otherwise non-zero.
  1041. See also        VF_cosec2,  VF_cosecrpi,  VF_sin,  VF_cosech,  sin
  1042.  
  1043.  
  1044. ┌────────────────────────────────────────────────────────────────────────────┐
  1045. │ VF_cosec2                VD_cosec2                VE_cosec2                │
  1046. │ VFx_cosec2               VDx_cosec2               VEx_cosec2               │
  1047. └────────────────────────────────────────────────────────────────────────────┘
  1048. Function        Square of the cosecant function
  1049. Syntax          #include <VFmath.h>
  1050.                 int  VF_cosec2(  fVector  Y,  fVector  X, ui size );
  1051.                 int  VFx_cosec2( fVector  Y,  fVector  X, ui size,
  1052.                                  float A, float B, float C );
  1053. Description     normal versions:    Yi =  cosec² ( Xi )
  1054.                 expanded versions:  Yi =  C *  cosec² ( A*Xi + B )
  1055.                 Calculating the squared trigonometric functions directly is
  1056.                 faster and sometimes more accurate than first calculating the
  1057.                 trigonometric function itself and squaring it afterwards.
  1058. Error handling  For SING, OVERFLOW, and TLOSS errors, the default result is
  1059.                 ±HUGE_VAL.
  1060. Return value    0, if no error occurred, otherwise non-zero.
  1061. See also        VF_cosec,   VF_cosecrpi,   sin
  1062.  
  1063.  
  1064. ┌────────────────────────────────────────────────────────────────────────────┐
  1065. │ VF_cosech                VD_cosech                VE_cosech                │
  1066. │ VFx_cosech               VDx_cosech               VEx_cosech               │
  1067. └────────────────────────────────────────────────────────────────────────────┘
  1068. Function        Hyperbolic cosecant function
  1069. Syntax          #include <VFmath.h>
  1070.                 int  VF_cosech(  fVector  Y,  fVector  X, ui size );
  1071.                 int  VFx_cosech( fVector  Y,  fVector  X, ui size,
  1072.                                  float A, float B, float C );
  1073. Description     normal versions:     Yi =  cosech ( Xi )
  1074.                 expanded versions:   Yi =  C * cosech ( A*Xi+B )
  1075. Error handling  SING errors lead to a default result of 0 (mean of +HUGE_VAL
  1076.                 and -HUGE_VAL); OVERFLOW errors lead to a default result
  1077.                 of ±HUGE_VAL.
  1078. Return value    0, if no error occurred, otherwise non-zero.
  1079. See also        VF_sinh,  VF_exp,   sinh
  1080.  
  1081.  
  1082. ┌────────────────────────────────────────────────────────────────────────────┐
  1083. │ VF_cosecrpi             VD_cosecrpi              VE_cosecrpi               │
  1084. │ VF_cosecrpi2            VD_cosecrpi2             VE_cosecrpi2              │
  1085. │ VF_cosecrpi3            VD_cosecrpi3             VE_cosecrpi3              │
  1086. └────────────────────────────────────────────────────────────────────────────┘
  1087. Function        Cosecant function of fractional multiples of Pi
  1088. Syntax          #include <VFmath.h>
  1089.                 int VF_cosecrpi(  fVector Y, iVector P, ui size, int q );
  1090.                 int VF_cosecrpi2( fVector Y, iVector P, ui size, int q );
  1091.                 int VF_cosecrpi3( fVector Y, iVector P, ui size, int q );
  1092. Description     Yi  =  cosec( (P[i] / q) * Pi )
  1093.                 The cosecant of fractional multiples of Pi is calculated.
  1094.                 There are three versions: VF_cosecrpi is for general use
  1095.                 with any arbitrary denominator q. If q is a power of 2,
  1096.                 VF_cosecrpi2 should be used which is a highly optimized
  1097.                 version using a look-up table. If q is a multiple of 3,
  1098.                 VF_cosecrpi3 should be used. VF_cosecrpi2 and VF_cosecrpi3
  1099.                 work also with q values they are not optimized for; in this
  1100.                 case, however, memory space is wasted for the tables.
  1101. Error handling  SING errors occur if P[i] / q  is exactly an integer number;
  1102.                 the default result is 0.0 (which is the mean of +HUGE_VAL and
  1103.                 -HUGE_VAL; in contrast to VF_cosec, 0.0 is chosen irrespective
  1104.                 of the fact that it is not a valid result of the cosecant
  1105.                 function);
  1106.                 q must be non-zero; this is, however, not tested for.
  1107. Return value    0, if no error occurred, otherwise non-zero.
  1108. See also        VF_cosec,    sin
  1109.  
  1110.  
  1111. ┌────────────────────────────────────────────────────────────────────────────┐
  1112. │ VF_cosectab2             VD_cosectab2             VE_cosectab2             │
  1113. │ VF_cosectab3             VD_cosectab3             VE_cosectab3             │
  1114. └────────────────────────────────────────────────────────────────────────────┘
  1115.                 Table of cosecant values for arguments between 0 and Pi/2.
  1116. Syntax          #include <xmath.h>
  1117.                 extern float     VF_cosectab2[ VF_tabsz2+1 ];
  1118.                 extern double    VD_cosectab2[ VD_tabsz2+1 ];
  1119.                 extern extended  VE_cosectab2[ VE_tabsz2+1 ];
  1120.                 extern float     VF_cosectab3[ VF_tabsz3+1 ];
  1121.                 extern double    VD_cosectab3[ VD_tabsz3+1 ];
  1122.                 extern extended  VE_cosectab3[ VE_tabsz3+1 ];
  1123. Description     VF_cosectab2[ i ]  =  cosec( i/(2*VF_tabsz2) * Pi ),
  1124.                                                       i=0,...,VF_tabsz2-1
  1125.                 VF_cosectab3[ i ]  =  cosec ( i/(2*VF_tabsz3) * Pi ),
  1126.                                                       i=0,...,VF_tabsz3-1
  1127.                 VF_cosectab2[ VF_tabsz2 ]  =  VF_cosectab3[ VF_tabsz3 ] = 0
  1128.                 These look-up tables of cosecant values for arguments between
  1129.                 0 and Pi/2 are used by VF_cosecrpi2 and the other functions
  1130.                 of that family and are also available to the user. Since the
  1131.                 cosecant of Pi/2 is not defined, zero is stored at its place.
  1132.                 The symbols VF_tabsz2 etc., denoting the size of the tables,
  1133.                 are defined in <xmath.h>.
  1134. See also        VF_cosecrpi2,  VF_tantab2,  VF_sintab2
  1135.  
  1136.  
  1137. ┌────────────────────────────────────────────────────────────────────────────┐
  1138. │ VF_cosh                  VD_cosh                  VE_cosh                  │
  1139. │ VCF_cosh                 VCD_cosh                 VCE_cosh                 │
  1140. │ VFx_cosh                 VDx_cosh                 VEx_cosh                 │
  1141. │ VCFx_cosh                VCDx_cosh                VCEx_cosh                │
  1142. └────────────────────────────────────────────────────────────────────────────┘
  1143. Function        Hyperbolic cosine function
  1144. Syntax          #include <VFmath.h>
  1145.                 int  VF_cosh(  fVector  Y,  fVector  X, ui size );
  1146.                 int  VFx_cosh( fVector  Y,  fVector  X, ui size,
  1147.                                float A, float B, float C );
  1148.                 int  VCF_cosh(  cfVector Y,  cfVector X, ui size );
  1149.                 int  VCFx_cosh( cfVector Y,  cfVector X, ui size,
  1150.                                 fComplex A, fComplex B, fComplex C );
  1151. Description     normal versions:     Yi =  cosh ( Xi )
  1152.                 expanded versions:   Yi =  C * cosh ( A*Xi+B )
  1153. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  1154. Return value    0, if no error occurred, otherwise non-zero.
  1155. See also        VF_sinh,  VF_exp,   cosh
  1156.  
  1157.  
  1158. ┌────────────────────────────────────────────────────────────────────────────┐
  1159. │ VF_cosrpi                VD_cosrpi                VE_cosrpi                │
  1160. │ VF_cosrpi2               VD_cosrpi2               VE_cosrpi2               │
  1161. │ VF_cosrpi3               VD_cosrpi3               VE_cosrpi3               │
  1162. └────────────────────────────────────────────────────────────────────────────┘
  1163. Function        Cosine function of fractional multiples of Pi
  1164. Syntax          #include <VFmath.h>
  1165.                 int VF_cosrpi(  fVector Y, iVector P, ui size, int q );
  1166.                 int VF_cosrpi2( fVector Y, iVector P, ui size, int q );
  1167.                 int VF_cosrpi3( fVector Y, iVector P, ui size, int q );
  1168. Description     Yi  =  cos( (P[i] / q) * Pi )
  1169.                 The cosine of fractional multiples of Pi is calculated. There
  1170.                 are three versions: VF_cosrpi is for general use with any
  1171.                 arbitrary denominator q. If q is a power of 2,  VF_cosrpi2
  1172.                 should be used which is a highly optimized version reading the
  1173.                 results from a look-up table, if possible. If q is a multiple
  1174.                 of 3,  VF_cosrpi3 should be used. VF_cosrpi3 offers a
  1175.                 convenient way to use degrees instead of radians; if, for
  1176.                 example, q is 180, the unit of the elements of P is "degree".
  1177.                 VF_cosrpi2 and VF_cosrpi3 work also with q values they are not
  1178.                 optimized for; in this case, however, memory space is wasted
  1179.                 for the tables.
  1180. Error handling  These functions are error-proof, as long as q != 0.
  1181. Return value    always 0
  1182. See also        VF_cos,    cos
  1183.  
  1184.  
  1185. ┌────────────────────────────────────────────────────────────────────────────┐
  1186. │ VF_cot                   VD_cot                   VE_cot                   │
  1187. │ VFx_cot                  VDx_cot                  VEx_cot                  │
  1188. └────────────────────────────────────────────────────────────────────────────┘
  1189. Function        Cotangent function
  1190. Syntax          #include <VFmath.h>
  1191.                 int  VF_cot(   fVector  Y,  fVector  X, ui size );
  1192.                 int  VFx_cot(  fVector  Y,  fVector  X, ui size,
  1193.                                float A, float B, float C );
  1194. Description     normal versions:     Yi  =  cot ( Xi )
  1195.                 expanded versions:   Yi  =  C * cot ( A*Xi+B )
  1196.                 The cotangent is defined as the inverse of the tangent (not to
  1197.                 be mistaken for the arcus function arctan!) For large values
  1198.                 of Xi, round-off error becomes appreciable; if the Xi values
  1199.                 are representable as rational multiples of Pi, it is better to
  1200.                 use VF_cotrpi  than VF_cot.
  1201. Error handling  For TLOSS precision errors, the default result is 0.0 (which
  1202.                 is the mean of +HUGE_VAL and -HUGE_VAL); for SING and OVERFLOW
  1203.                 errors, the default result is ±HUGE_VAL.
  1204. Return value    0, if no error occurred, otherwise non-zero.
  1205. See also        VF_cot2,  VF_cotrpi,  VF_coth,  VF_atan,  VF_atan2, tan
  1206.  
  1207.  
  1208. ┌────────────────────────────────────────────────────────────────────────────┐
  1209. │ VF_cot2                  VD_cot2                  VE_cot2                  │
  1210. │ VFx_cot2                 VDx_cot2                 VEx_cot2                 │
  1211. └────────────────────────────────────────────────────────────────────────────┘
  1212. Function        Square of the cotangent function
  1213. Syntax          #include <VFmath.h>
  1214.                 int  VF_cot2(  fVector  Y,  fVector  X, ui size );
  1215.                 int  VFx_cot2( fVector  Y,  fVector  X, ui size,
  1216.                                float A, float B, float C );
  1217. Description     normal versions:   Yi  =  cot²( Xi )
  1218.                 expanded versions: Yi  =  C *  cot²( A*Xi+B )
  1219.                 Calculating the squared trigonometric functions directly is
  1220.                 faster and sometimes more accurate than first calculating the
  1221.                 trigonometric function itself and squaring it afterwards.
  1222. Error handling  For SING,  OVERFLOW and TLOSS errors, the default result is
  1223.                 +HUGE_VAL (multiplied by the sign of C in the expanded
  1224.                 versions).
  1225. Return value    0, if no error occurred, otherwise non-zero.
  1226. See also        VF_cot,   VF_cotrpi,   sin
  1227.  
  1228.  
  1229. ┌────────────────────────────────────────────────────────────────────────────┐
  1230. │ VF_coth                  VD_coth                  VE_coth                  │
  1231. │ VFx_coth                 VDx_coth                 VEx_coth                 │
  1232. └────────────────────────────────────────────────────────────────────────────┘
  1233. Function        Hyperbolic cotangent function
  1234. Syntax          #include <VFmath.h>
  1235.                 int  VF_coth(  fVector  Y,  fVector  X, ui size );
  1236.                 int  VFx_coth( fVector  Y,  fVector  X, ui size,
  1237.                                float A, float B, float C );
  1238. Description     normal versions:     Yi  =  coth ( Xi )
  1239.                 expanded versions:   Yi  =  C * coth ( A*Xi+B )
  1240. Error handling  SING errors lead to a default result of 0.0 (the mean of
  1241.                 +HUGE_VAL and -HUGE_VAL);  OVERFLOW errors lead to a default
  1242.                 result of ±HUGE_VAL.
  1243. Return value    0, if no error occurred, otherwise non-zero.
  1244. See also        VF_sinh,  VF_tanh,  VF_exp,   tanh
  1245.  
  1246.  
  1247. ┌────────────────────────────────────────────────────────────────────────────┐
  1248. │ VF_cotrpi                VD_cotrpi                VE_cotrpi                │
  1249. │ VF_cotrpi2               VD_cotrpi2               VE_cotrpi2               │
  1250. │ VF_cotrpi3               VD_cotrpi3               VE_cotrpi3               │
  1251. └────────────────────────────────────────────────────────────────────────────┘
  1252. Function        Cotangent function of rational multiples of Pi
  1253. Syntax          #include <VFmath.h>
  1254.                 int VF_cotrpi(  fVector Y, iVector P, ui size, int q );
  1255.                 int VF_cotrpi2( fVector Y, iVector P, ui size, int q );
  1256.                 int VF_cotrpi3( fVector Y, iVector P, ui size, int q );
  1257. Description     Yi  =  cot( (P[i] / q) * Pi )
  1258.                 The cotangent of fractional multiples of Pi is calculated.
  1259.                 There are three versions: VF_cotrpi is for general use with
  1260.                 any arbitrary denominator q. If q is a power of 2,  VF_cotrpi2
  1261.                 should be used which is a highly optimized version using a
  1262.                 look-up table. If q is a multiple of 3,  VF_cotrpi3 should be
  1263.                 used. VF_cotrpi2 and VF_cotrpi3 also work with q values they
  1264.                 are not optimized for; in this case, however, memory space is
  1265.                 wasted for the tables.
  1266. Error handling  SING errors occur if P[i] / q  is a whole number. The default
  1267.                 result is 0.0 (which is the mean of +HUGE_VAL and -HUGE_VAL);
  1268.                 q must be non-zero; this is, however, not tested for.
  1269. Return value    0, if no error occurred, otherwise non-zero.
  1270. See also        VF_cot,    tan
  1271.  
  1272.  
  1273. ┌────────────────────────────────────────────────────────────────────────────┐
  1274. │ VF_cprint                VD_cprint                VE_cprint                │
  1275. │ VCF_cprint               VCD_cprint               VCE_cprint               │
  1276. │ VI_cprint           VSI_cprint          VLI_cprint          VQI_cprint     │
  1277. │ VU_cprint           VUS_cprint          VUL_cprint          VUI_cprint     │
  1278. └────────────────────────────────────────────────────────────────────────────┘
  1279. Function        print a vector to the screen
  1280. Syntax          #include <VFstd.h>
  1281.                 VF_cprint( fVector X, ui size, unsigned nperline );
  1282. Description     size elements of X are printed to the screen (or "console"),
  1283.                 into the actual text window, nperline elements in each line.
  1284.  
  1285.                 The display starts always with a new line. Please note that
  1286.                 this may lead to an empty line at the beginning.
  1287.                 Each line begins with the index of the first element printed
  1288.                 into that line. The index is followed by a colon and by
  1289.                 the requested nperline elements.
  1290.                 Complex numbers are printed in braces, with the real and
  1291.                 imaginary parts separated by a komma:  {Re, Im}.
  1292.  
  1293.                 The display pauses every screenful. The user is prompted
  1294.                 after each page to continue or to stop printing.
  1295.                 The number of digits per element is determined by the
  1296.                 available space, which depends in turn on the line width
  1297.                 and on the parameter nperline.
  1298.  
  1299.                 This family of functions is not available under Windows and
  1300.                 should not be used within TurboVision programs.
  1301. Error handling  If nperline exceeds the maximum number of entries possible in
  1302.                 the current text mode, an error message "Cannot use requested
  1303.                 format (too many entries per line)!" is generated; in this
  1304.                 case, the program chooses the maximum number nperline that is
  1305.                 possible.
  1306. Return value    none
  1307. See also        cprintf, VF_fprint,  VF_print,  VF_write, VF_store
  1308.  
  1309.  
  1310. ┌────────────────────────────────────────────────────────────────────────────┐
  1311. │ VF_CtoAbs                VD_CtoAbs                VE_CtoAbs                │
  1312. └────────────────────────────────────────────────────────────────────────────┘
  1313. Function        Absolute value (magnitude) of complex numbers
  1314. Syntax          #include <VCFstd.h>
  1315.                 void VF_CtoAbs( fVector Abs, cfVector X, ui size );
  1316. Description     Abs[i]  =  sqrt( Re²(Xi) + Im²(Xi) )
  1317.                 The absolute value, i.e. the magnitude of each element of the
  1318.                 complex vector X is calculated. This function is almost
  1319.                 identical to VCF_abs, but does not perform any error handling.
  1320. Error handling  none
  1321. Return value    none
  1322. See also        VCF_abs,  VF_PolartoC, VF_CtoReIm, VF_CtoArg, VF_CtoNorm
  1323.  
  1324.  
  1325. ┌────────────────────────────────────────────────────────────────────────────┐
  1326. │ VF_CtoArg                VD_CtoArg                VE_CtoArg                │
  1327. └────────────────────────────────────────────────────────────────────────────┘
  1328. Function        Argument (angle) of complex numbers
  1329. Syntax          #include <VCFstd.h>
  1330.                 void VF_CtoArg( fVector Arg, cfVector X, ui size );
  1331. Description     Arg[i]  =  arctan( Im(Xi) / Re(Xi) )
  1332.                 The argument, i.e. the angle of each element of the complex
  1333.                 vector X is calculated. For Cartesian coordinates {0, 0}, the
  1334.                 angle is arbitrary and is set to zero.
  1335.                 When necessary, depending on the signs of Re(Xi) and Im(Xi),
  1336.                 Pi is added or subtracted from the arctan to obtain the
  1337.                 correct quadrant.
  1338. Error handling  none
  1339. Return value    none
  1340. See also        VF_PolartoC, VF_CtoPolar, VF_atan2, VF_CtoAbs, VF_CtoReIm
  1341.  
  1342.  
  1343. ┌────────────────────────────────────────────────────────────────────────────┐
  1344. │ VF_CtoIm                 VD_CtoIm                 VE_CtoIm                 │
  1345. └────────────────────────────────────────────────────────────────────────────┘
  1346. Function        Extract the imaginary part from a complex vector.
  1347. Syntax          #include <VCFstd.h>
  1348.                 void VF_CtoIm( fVector Im, cfVector X, ui size );
  1349. Description     The imaginary part of the complex vector X is extracted and
  1350.                 stored in Im.
  1351. Error handling  none
  1352. Return value    none
  1353. See also        VF_CtoReIm, VF_ReImtoC,  VF_ImtoC, VF_PolartoC, VF_extract
  1354.  
  1355.  
  1356. ┌────────────────────────────────────────────────────────────────────────────┐
  1357. │ VF_CtoNorm               VD_CtoNorm               VE_CtoNorm               │
  1358. └────────────────────────────────────────────────────────────────────────────┘
  1359. Function        Norm (square of the absolute value) of complex numbers
  1360. Syntax          #include <VCFstd.h>
  1361.                 void VF_CtoNorm( fVector Norm, cfVector X, ui size );
  1362. Description     Norm[i]  =  Re²(Xi) + Im²(Xi)
  1363.                 This definition of the Norm of a complex number is the same as
  1364.                 in C++, but it is not consistent with the usual definition in
  1365.                 mathematics, where the term "norm" is used as a synomym for
  1366.                 "absolute value" or "magnitude". As defined here, the Norm is
  1367.                 the square of the absolute value. The absolute value itself is
  1368.                 available by the functions VF_CtoAbs (without error handling)
  1369.                 and VCF_abs (with error handling).
  1370. Error handling  none
  1371. Return value    none
  1372. See also        VF_PolartoC, VF_CtoReIm, VF_CtoArg, VF_CtoAbs
  1373.  
  1374.  
  1375. ┌────────────────────────────────────────────────────────────────────────────┐
  1376. │ VF_CtoPolar              VD_CtoPolar              VE_CtoPolar              │
  1377. └────────────────────────────────────────────────────────────────────────────┘
  1378. Function        Transformation of complex numbers from Cartesian into polar
  1379.                 coordinates.
  1380. Syntax          #include <VCFstd.h>
  1381.                 void VF_CtoPolar( fVector Mag, fVector Arg,
  1382.                                   cfVector X, ui size );
  1383. Description     The polar coordinates Mag (magnitude, absolute value) and Arg
  1384.                 (argument, angle) of each element of the Cartesian complex
  1385.                 vector X are calculated. For the Cartesian coordinates {0, 0},
  1386.                 the polar coordinates are also set to {0, 0}.
  1387. Error handling  none
  1388. Return value    none
  1389. See also        VF_PolartoC,  VF_CtoReIm,  VF_CtoAbs,  VF_CtoArg,  VF_CtoNorm
  1390.  
  1391.  
  1392. ┌────────────────────────────────────────────────────────────────────────────┐
  1393. │ VF_CtoRe                 VD_CtoRe                 VE_CtoRe                 │
  1394. └────────────────────────────────────────────────────────────────────────────┘
  1395. Function        Extracts the real part from a complex vector.
  1396. Syntax          #include <VCFstd.h>
  1397.                 void VF_CtoRe( fVector Re, cfVector X, ui size );
  1398. Description     The real part of the complex vector X is extracted and stored
  1399.                 in Re.
  1400. Error handling  none
  1401. Return value    none
  1402. See also        VF_CtoReIm,  VF_ReImtoC,  VF_RetoC,  VF_PolartoC,  VF_extract
  1403.  
  1404.  
  1405. ┌────────────────────────────────────────────────────────────────────────────┐
  1406. │ VF_CtoReIm               VD_CtoReIm               VE_CtoReIm               │
  1407. └────────────────────────────────────────────────────────────────────────────┘
  1408. Function        Extracts the real and imaginary parts from a complex vector.
  1409. Syntax          #include <VCFstd.h>
  1410.                 void VF_CtoReIm( fVector Re, fVector Im, cfVector X, ui size );
  1411. Description     The real and imaginary parts of the complex vector X are
  1412.                 extracted and stored in Re and Im, resp.
  1413. Error handling  none
  1414. Return value    none
  1415. See also        VF_CtoRe,  VF_ReImtoC,  VF_RetoC,  VF_PolartoC,  VF_extract
  1416.  
  1417.  
  1418. ┌────────────────────────────────────────────────────────────────────────────┐
  1419. │ VF_cubic                 VD_cubic                 VE_cubic                 │
  1420. │ VCF_cubic                VCD_cubic                VCE_cubic                │
  1421. │ VFx_cubic                VDx_cubic                VEx_cubic                │
  1422. │ VCFx_cubic               VCDx_cubic               VCEx_cubic               │
  1423. └────────────────────────────────────────────────────────────────────────────┘
  1424. Function        Cubic (third power)
  1425. Syntax          #include <VFmath.h>
  1426.                 int  VF_cubic(  fVector  Y,  fVector  X, ui size );
  1427.                 int  VFx_cubic(  fVector  Y,  fVector  X, ui size,
  1428.                                  float A, float B );
  1429. Description     normal versions:   Yi  =  (Xi)**3
  1430.                 expanded versions: Yi  =  (A*Xi+B)**3
  1431. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  1432. Return value    0, if no error occurred, otherwise non-zero
  1433. See also        VF_square,   VF_quartic,  VF_sqrt,  VF_pow,  VF_ipow,  VF_poly
  1434.  
  1435.  
  1436. ┌────────────────────────────────────────────────────────────────────────────┐
  1437. │ VCF_dataPlot             VCD_dataPlot             VCE_dataPlot             │
  1438. └────────────────────────────────────────────────────────────────────────────┘
  1439. Function        Plot of a complex vector into an existing Cartesian complex
  1440.                 plane.
  1441. Syntax          #include <Vgraph.h>
  1442.                 void VCF_dataPlot( cfVector X, ui size,
  1443.                                    unsigned form,  COLORREF color );
  1444. Description     The vector X is plotted into a Cartesian complex plane that
  1445.                 has to be already drawn by a prior call to either
  1446.                 VCF_autoPlot, or VCF_2AutoPlot  or V_drawAxes.
  1447.                 For a description of the parameters form and color, see
  1448.                 VF_xyAutoPlot.
  1449. Error handling  none
  1450. Return value    none
  1451. See also        VCF_autoPlot,  VCF_2AutoPlot, VF_xyAutoPlot,  chapter 4.11
  1452.  
  1453.  
  1454. ┌────────────────────────────────────────────────────────────────────────────┐
  1455. │ VF_deconvolve            VD_deconvolve            VE_deconvolve            │
  1456. └────────────────────────────────────────────────────────────────────────────┘
  1457. Function        Deconvolution
  1458. Syntax          #include <VFstd.h>
  1459.                 void VF_deconvolve( fVector Y, fVector Flt, fVector X,
  1460.                                     fVector Rsp, ui size );
  1461. Description     X is assumed to be the result of a convolution of some "true"
  1462.                 profile with the response function Rsp; a deconvolution is
  1463.                 attempted and stored in Y. A filter Flt is also calculated; if
  1464.                 more than one vector is to be deconvolved with the same Rsp,
  1465.                 use VF_deconvolve only once and use the filter Flt thus
  1466.                 obtained to deconvolve other vectors by calling VF_filter.
  1467.                 The response has to be stored in Rsp in wrap-around order:
  1468.                 the elements for zero and positive times (or whatever the
  1469.                 independent variable is) are stored as Rsp[0]  to Rsp[size/2]
  1470.                 and the elements for negative times as Rsp[size/2+1] to
  1471.                 Rsp[size-1].
  1472.                 You may wish to use VF_rotate or VF_reflect to obtain the
  1473.                 correct order when constructing the response vector.
  1474.  
  1475.                 X, Y, Rsp, and Flt must all be of the same size, which has to
  1476.                 be an integer power of 2.  X may be overwritten by Y, Rsp may
  1477.                 be overwritten by Flt, but X and Flt as well as Y and Rsp
  1478.                 have to be distinct from each other.
  1479.  
  1480.                 Mathematically, Flt is the inverse of the Fourier transform of
  1481.                 Rsp. If the Fourier transform of Rsp contains elements equal
  1482.                 to zero, all information is lost for the respective frequency
  1483.                 and no reconstruction is possible. The best one can do in
  1484.                 this case is to accept this loss and to  deconvolve only up
  1485.                 to those frequencies where still something is left to be
  1486.                 reconstructed.
  1487.                 You are therefore advised not to use this function blindly
  1488.                 but rather to inspect the Fourier transform of Rsp and
  1489.                 decide what to do on the basis of your specific application.
  1490.                 If you wish to use this function nevertheless, you may rely
  1491.                 on the automatic editing of the filter, built into
  1492.                 VF_deconvolve. Thereby, Flt is set to zero (instead of
  1493.                 infinity) at those frequences where all information has
  1494.                 been lost. You may set the threshold for this implicit
  1495.                 editing by VF_setRspEdit. In order to retrieve the threshold
  1496.                 actually set, use VF_getRspEdit.
  1497.  
  1498.                 This deconvolution is based on the implicit assumption that
  1499.                 X is periodic; if this is not the case, see the description
  1500.                 of  VF_convolve  about how to avoid end effects.
  1501.  
  1502.                 About special versions with the prefixes  VFs_  and VFl_,
  1503.                 consult chapter 4.8.
  1504. Error handling  If size is not a power of 2,  VF_FFT  (on which VF_deconvolve
  1505.                 is based) complains "Size must be an integer power of 2" and
  1506.                 the program is aborted.
  1507.                 If, by VF_setRspEdit, you specified Trunc.Re = Trunc.Im = 0,
  1508.                 SING errors may occur that are handled by setting Flt to
  1509.                 ±HUGE_VAL at the respective frequency. During multiplication
  1510.                 with the transform of X, this may lead to unhandled floating-
  1511.                 point overflow errors (in case your guess of Rsp was wrong
  1512.                 and there is some information left at the frequencies where
  1513.                 you thought it was not).
  1514. Return value    none
  1515. See also        VF_filter,  VF_convolve, VF_FFT,  VF_xcorr, VF_spectrum
  1516.  
  1517.  
  1518. ┌────────────────────────────────────────────────────────────────────────────┐
  1519. │ VF_delete                VD_delete                VE_delete                │
  1520. │ VCF_delete               VCD_delete               VCE_delete               │
  1521. │ VI_delete           VSI_delete          VLI_delete          VQI_delete     │
  1522. │ VU_delete           VUS_delete          VUL_delete          VUI_delete     │
  1523. └────────────────────────────────────────────────────────────────────────────┘
  1524. Function        Delete one element from a vector
  1525. Syntax          #include <VFstd.h>
  1526.                 void  VF_delete( fVector X, ui size, ui pos );
  1527. Description     This is one of the few functions where the input vector itself
  1528.                 is changed, instead of being mapped onto an output vector.
  1529.                 The element numbered  pos is deleted from the vector, and all
  1530.                 the following elements are shifted one position lower; the
  1531.                 last element is left undefined.
  1532. Error handling  none
  1533. Return value    none
  1534. See also        VF_rotate, VF_insert
  1535.  
  1536.  
  1537. ┌────────────────────────────────────────────────────────────────────────────┐
  1538. │ VF_derivC                VD_derivC                VE_derivC                │
  1539. └────────────────────────────────────────────────────────────────────────────┘
  1540. Function        Derivative of an array with respect to an independent
  1541.                 variable sampled at constant intervals
  1542. Syntax          #include <VFstd.h>
  1543.                 void  VF_derivC(  fVector Y,  fVector  X,  ui size,
  1544.                                   float DeltaT );
  1545. Description     Y(t) = dX(t) / dt.
  1546.                 The vector X is assumed to be a function of a variable t; the
  1547.                 t values themselves are equally spaced. Therefore, only the
  1548.                 spacing, DeltaT, must be passed to the function. By parabolic
  1549.                 interpolation, the derivative of X with respect to t is
  1550.                 calculated. This function does the inverse of the integration
  1551.                 by  VF_runintegralC.
  1552. Error handling  none
  1553. Return value    none
  1554. See also        VF_derivV,  VF_runintegralC
  1555.  
  1556.  
  1557. ┌────────────────────────────────────────────────────────────────────────────┐
  1558. │ VF_derivV                VD_derivV                VE_derivV                │
  1559. └────────────────────────────────────────────────────────────────────────────┘
  1560. Function        Derivative of one array with respect to another
  1561. Syntax          #include <VFstd.h>
  1562.                 void  VF_derivV(  fVector Z, fVector X,  fVector Y, ui size );
  1563. Description     Z(X)  = dY(X) / dX.
  1564.                 The derivative of  Y with respect to X is calculated by
  1565.                 parabolic interpolation and stored in Z. If the elements of X
  1566.                 are equally-spaced, it is better to use VF_derivC. The inverse
  1567.                 procedure, i.e. integration, is performed by VF_runintegralV.
  1568. Error handling  none
  1569. Return value    none
  1570. See also        VF_derivC,  VF_runintegralV
  1571.  
  1572.  
  1573. ┌────────────────────────────────────────────────────────────────────────────┐
  1574. │ VF_distribution          VD_distribution          VE_distribution          │
  1575. └────────────────────────────────────────────────────────────────────────────┘
  1576. Function        Distribution function
  1577. Syntax          #include <VFstd.h>
  1578.                 ui  VF_distribution(
  1579.                      uiVector Abund, fVector Limits, ui nbins,
  1580.                      fVector X, ui sizex,
  1581.                      int mode );
  1582. Description     This function counts the number of elements of X falling
  1583.                 into each of the intervals defined by Limits. The abundances
  1584.                 thus determined are stored in Abund.
  1585.                 nbins is the number of elements of Limits, i.e. the number
  1586.                 of intervals. sizex is the size of X.
  1587.  
  1588.                 Limits must be in ascending order. The spacing between the
  1589.                 elements of Limits need not necessarily be constant.
  1590.  
  1591.                 The parameter mode specifies how to interpret the values
  1592.                 given in Limits.
  1593.                   mode > 0:  Limits contains the upper limits of the
  1594.                              intervals
  1595.                   mode < 0:  Limits contains the lower limits of the
  1596.                              intervals
  1597.                   mode = 0:  Limits contains the mid-points of the intervals.
  1598.                              An element of X belongs to the element of Limits
  1599.                              closest to it. In case of exactly equal dis-
  1600.                              tances, the interval with the lower index is
  1601.                              chosen.
  1602.                              The interval defined by Limits[0] extends down
  1603.                              to -HUGE_VAL, the interval defined by
  1604.                              Limits[nbins-1] reaches up to +HUGE_VAL.
  1605.  
  1606.                 The number of elements of X not falling into one of the
  1607.                 intervals is returned. For mode > 0, these are the elements
  1608.                 greater than the highest limit. For mode < 0, these are the
  1609.                 elements smaller than the lowest limit.
  1610.                 For mode = 0, the return value is always zero, because
  1611.                 the intervals are open on both sides. So every element
  1612.                 of X is accounted for in Abund.
  1613.  
  1614.                 In order to get the normalized distribution function,
  1615.                 use the sequence
  1616.                      VF_distribution( Abund, Limits, nbins, X, sizex, 0 );
  1617.                      V_UItoD( Y, Abund, nbins );
  1618.                      VD_divC( Y, Y, nbins, VD_integralV(Limits,Y,nbins) );
  1619.  
  1620.                 After that, a call to
  1621.                      VD_runintegralC( Y, Y, nbins, 1.0 );
  1622.                 yields the cumulated distribution function.
  1623. Error handling  none
  1624. Return value    number of elements of X not accounted for in Abund
  1625. See also        VF_searchV
  1626.  
  1627.  
  1628. ┌────────────────────────────────────────────────────────────────────────────┐
  1629. │ VF_divC                  VD_divC                  VE_divC                  │
  1630. │ VCF_divC                 VCD_divC                 VCE_divC                 │
  1631. │ VCF_divReC               VCD_divReC               VCE_divReC               │
  1632. │ VI_divC             VSI_divC            VLI_divC            VQI_divC       │
  1633. │ VU_divC             VUS_divC            VUL_divC            VUI_divC       │
  1634. └────────────────────────────────────────────────────────────────────────────┘
  1635. Function        Divide by a constant
  1636. Syntax          #include <VFmath.h>
  1637.                 void VF_divC( fVector Y, fVector X, ui size, float C );
  1638.                 void  VCF_divC(  cfVector Y,  cfVector X,  ui size,
  1639.                                  fComplex C );
  1640.                 void  VCF_divReC( cfVector Y, cfVector X,  ui size,
  1641.                                   float CRe );
  1642. Description     Yi  =  Xi / C
  1643.                 The integer versions perform an integer division, discarding
  1644.                 the remainder; the remainder itself may be obtained by the
  1645.                 functions of the VI_modC family.
  1646.                 The complex floating-point versions exist in two variants, one
  1647.                 for complex constants C, the other for real-valued constants
  1648.                 CRe by which the complex vector is divided.
  1649. Error handling  none
  1650. Return value    none
  1651. See also        VF_divV,   VF_addC,  VF_subC,  VF_mulC,  VF_divrC,  VF_modC,
  1652.                 VF_visC,  VF_redC
  1653.  
  1654.  
  1655. ┌────────────────────────────────────────────────────────────────────────────┐
  1656. │ VF_divrC                 VD_divrC                 VE_divrC                 │
  1657. │ VCF_divrC                VCD_divrC                VCE_divrC                │
  1658. │ VCF_divrReC              VCD_divrReC              VCE_divrReC              │
  1659. │ VFx_divrC                VDx_divrC                VEx_divrC                │
  1660. │ VCFx_divrC               VCDx_divrC               VCEx_divrC               │
  1661. │ VI_divrC            VSI_divrC           VLI_divrC           VQI_divrC      │
  1662. │ VU_divrC            VUS_divrC           VUL_divrC           VUI_divrC      │
  1663. └────────────────────────────────────────────────────────────────────────────┘
  1664. Function        Reverse division: divide a constant by a vector
  1665. Syntax          #include <VFmath.h>
  1666.                 void  VF_divrC( fVector Y, fVector X, ui size, float C );
  1667.                 void  VFx_divrC( fVector Y, fVector X, ui size,
  1668.                                  float A, float B, float C );
  1669.                 void  VCF_divrC( cfVector Y,  cfVector X,  ui size,
  1670.                                  fComplex C );
  1671.                 void  VCFx_divrC( cfVector Y, cfVector X, ui size,
  1672.                                   fComplex A, fComplex B, fComplex C );
  1673.                 void  VCF_divrReC( cfVector Y, cfVector X,  ui size,
  1674.                                    float CRe );
  1675. Description     normal versions:   Yi  =   C / Xi
  1676.                 expanded versions: Yi  =   C / (A*Xi+B)
  1677.                 The complex floating-point versions exist in two variants, one
  1678.                 for complex constants C, the other for real-valued constants
  1679.                 CRe which are divided by the complex vector.
  1680. Error handling  none;  for the floating-point versions, there are related
  1681.                 functions that calculate  1.0 / Xi   and  1.0 / (A*Xi+B):
  1682.                 VF_inv and VFx_inv, respectively; both of these detect and
  1683.                 handle SING errors.
  1684. Return value    none
  1685. See also        VF_divV,  VF_inv, VF_addC,  VF_subC,  VF_mulC,  VF_divC,
  1686.                 VF_modC, VF_visC,  VF_redC
  1687.  
  1688.  
  1689. ┌────────────────────────────────────────────────────────────────────────────┐
  1690. │ VF_divrV                 VD_divrV                 VE_divrV                 │
  1691. │ VCF_divrV                VCD_divrV                VCE_divrV                │
  1692. │ VCF_divrReV              VCD_divrReV              VCE_divrReV              │
  1693. │ VFx_divrV                VDx_divrV                VEx_divrV                │
  1694. │ VCFx_divrV               VCDx_divrV               VCEx_divrV               │
  1695. │ VCFx_divrReV             VCDx_divrReV             VCEx_divrReV             │
  1696. │ VI_divrV            VSI_divrV           VLI_divrV           VQI_divrV      │
  1697. │ VU_divrV            VUS_divrV           VUL_divrV           VUI_divrV      │
  1698. └────────────────────────────────────────────────────────────────────────────┘
  1699. Function        Divide two vectors in reverse order
  1700. Syntax          #include <VFmath.h>
  1701.                 void  VF_divrV( fVector Z, fVector X, fVector Y, ui size );
  1702.                 void  VFx_divrV( fVector Z,  fVector X, fVector Y,
  1703.                                  ui size, float A,  float  B );
  1704.                 void  VCF_divrV( cfVector Z, cfVector  X, cfVector Y,
  1705.                                  ui size );
  1706.                 void  VCF_divrReV( cfVector Z, cfVector X, fVector Y,
  1707.                                    ui size );
  1708.                 void  VCFx_divrV(  cfVector Z, cfVector X, cfVector Y,
  1709.                                    ui size, fComplex A, fComplex B );
  1710.                 void  VCFx_divrReV( cfVector Z, cfVector X, fVector Y,
  1711.                                     ui size, fComplex A, fComplex B );
  1712. Description     normal versions:   Zi  =   Yi / Xi
  1713.                 expanded versions: Zi  =   Yi / (A*Xi+B)
  1714.                 The complex floating-point versions exist in two variants: in
  1715.                 the first variant (e.g., VCF_divrV,  VCFx_divrV), X, Y, and Z
  1716.                 are all complex; in the second variant, Y is real-valued
  1717.                 (e.g., VCF_divrReV - "division in reverse order: divide a
  1718.                 real vector by a complex one").
  1719. Error handling  none
  1720. Return value    none
  1721. See also        VF_divrC,  VF_addV,  VF_mulV,  VF_modV,  VF_visV,  VF_redV
  1722.  
  1723.  
  1724. ┌────────────────────────────────────────────────────────────────────────────┐
  1725. │ VF_divV                  VD_divV                  VE_divV                  │
  1726. │ VCF_divV                 VCD_divV                 VCE_divV                 │
  1727. │ VCF_divReV               VCD_divReV               VCE_divReV               │
  1728. │ VFs_divV                 VDs_divV                 VEs_divV                 │
  1729. │ VFx_divV                 VDx_divV                 VEx_divV                 │
  1730. │ VCFx_divV                VCDx_divV                VCEx_divV                │
  1731. │ VCFx_divReV              VCDx_divReV              VCEx_divReV              │
  1732. │ VI_divV             VSI_divV            VLI_divV            VQI_divV       │
  1733. │ VU_divV             VUS_divV            VUL_divV            VUI_divV       │
  1734. └────────────────────────────────────────────────────────────────────────────┘
  1735. Function        Divide two vectors
  1736. Syntax          #include <VFmath.h>
  1737.                 void VF_divV( fVector Z, fVector X, fVector Y, ui size );
  1738.                 void VFs_divV( fVector Z, fVector X, fVector Y, ui size,
  1739.                                float C );
  1740.                 void VFx_divV( fVector Z,  fVector X, fVector Y,
  1741.                                ui size, float A,  float  B );
  1742.                 void  VCF_divV( cfVector Z, cfVector  X, cfVector Y,
  1743.                                 ui size );
  1744.                 void  VCF_divReV( cfVector Z, cfVector X, fVector Y,
  1745.                                   ui size );
  1746.                 void  VCFx_divV(  cfVector Z, cfVector X, cfVector Y,
  1747.                                   ui size, fComplex A, fComplex B );
  1748.                 void  VCFx_divReV( cfVector Z, cfVector X, fVector Y,
  1749.                                    ui size, fComplex A, fComplex B );
  1750. Description     normal versions:    Zi  =  Xi / Yi
  1751.                 scaled versions:    Zi  =  C * (Xi / Yi)
  1752.                 expanded versions:  Zi  =  (A*Xi+B) / Yi
  1753.                 The complex floating-point versions exist in two variants: in
  1754.                 the first variant (e.g., VCF_divV,  VCFx_divV),  X, Y, and Z
  1755.                 are all complex; in the second variant, Y is real-valued
  1756.                 (e.g., VCF_divReV - "divide by a real vector").
  1757. Error handling  none
  1758. Return value    none
  1759. See also        VF_divC,  VF_addV,  VF_mulV,  VF_modV,  VF_visV,  VF_redV
  1760.  
  1761.  
  1762. ┌────────────────────────────────────────────────────────────────────────────┐
  1763. │ V_drawAxes                                                                 │
  1764. └────────────────────────────────────────────────────────────────────────────┘
  1765. Function        Draws a Cartesian coordinate system.
  1766. Syntax          #include <Vgraph.h>
  1767.                 void V_drawAxes( long double Xmin, long double Xmax,
  1768.                                  long double Ymin, long double Ymax );
  1769. Description     A Cartesian coordinate system is drawn with the axes scaled
  1770.                 according to the values passed as Xmin, Xmax, Ymin, and Ymax.
  1771.                 Ten subdivision lines are drawn on each axis. No adjustment
  1772.                 of this scaling is performed; if automatic fine-tuning of the
  1773.                 scaling is desired, call V_findAxes instead. Before using this
  1774.                 function, either V_initGraph or V_initPlot has to be called.
  1775.                 V_drawAxes is used internally by all functions of the AutoPlot
  1776.                 family.
  1777. Error handling  none
  1778. Return value    none
  1779. See also        V_findAxes,   V_initPlot,   VF_xyAutoPlot,   VF_xyDataPlot,
  1780.                 chapter 4.11
  1781.  
  1782.  
  1783. ┌────────────────────────────────────────────────────────────────────────────┐
  1784. │ V_DtoF                   V_DtoE                                            │
  1785. └────────────────────────────────────────────────────────────────────────────┘
  1786. Function        Data type conversions.  See V_FtoD.
  1787.  
  1788.  
  1789. ┌────────────────────────────────────────────────────────────────────────────┐
  1790. │ VF_equ0                  VD_equ0                  VE_equ0                  │
  1791. │ VCF_equ0                 VCD_equ0                 VCE_equ0                 │
  1792. │ VI_equ0             VSI_equ0            VLI_equ0            VQI_equ0       │
  1793. │ VU_equ0             VUS_equ0            VUL_equ0            VUI_equ0       │
  1794. └────────────────────────────────────────────────────────────────────────────┘
  1795. Function        (Re-) initialize a vector with zero.
  1796. Syntax          #include <VFstd.h>
  1797.                 void VF_equ0( fVector X, ui size );
  1798. Description     Xi = 0
  1799. Error handling  none
  1800. Return value    none
  1801. See also        VF_equ1, VF_equC, VF_equV
  1802.  
  1803.  
  1804. ┌────────────────────────────────────────────────────────────────────────────┐
  1805. │ VF_equ1                  VD_equ1                  VE_equ1                  │
  1806. │ VCF_equ1                 VCD_equ1                 VCE_equ1                 │
  1807. └────────────────────────────────────────────────────────────────────────────┘
  1808. Function        Initialize a vector with 1.0.
  1809. Syntax          #include <VFstd.h>
  1810.                 void VF_equ1( fVector X,  ui size );
  1811. Description     Xi = 1.0
  1812.                 In the complex versions, the imaginary parts are set to zero.
  1813. Error handling  none
  1814. Return value    none
  1815. See also        VF_equ0, VF_equC, VF_equV
  1816.  
  1817.  
  1818. ┌────────────────────────────────────────────────────────────────────────────┐
  1819. │ VF_equC                  VD_equC                  VE_equC                  │
  1820. │ VCF_equC                 VCD_equC                 VCE_equC                 │
  1821. │ VI_equC             VSI_equC            VLI_equC            VQI_equC       │
  1822. │ VU_equC             VUS_equC            VUL_equC            VUI_equC       │
  1823. └────────────────────────────────────────────────────────────────────────────┘
  1824. Function        Initializes a vector with a constant value.
  1825. Syntax          #include <VFstd.h>
  1826.                 void VF_equC(  fVector X,  ui size, float C );
  1827. Description     Xi = C
  1828. Error handling  none
  1829. Return value    none
  1830. See also        VF_equ0, VF_equ1, VF_equV, VF_comb
  1831.  
  1832.  
  1833.  
  1834. ┌────────────────────────────────────────────────────────────────────────────┐
  1835. │ VF_equV                  VD_equV                  VE_equV                  │
  1836. │ VCF_equV                 VCD_equV                 VCE_equV                 │
  1837. │ VFx_equV                 VDx_equV                 VEx_equV                 │
  1838. │ VCFx_equV                VCDx_equV                VCEx_equV                │
  1839. │ VI_equV             VSI_equV            VLI_equV            VQI_equV       │
  1840. │ VU_equV             VUS_equV            VUL_equV            VUI_equV       │
  1841. └────────────────────────────────────────────────────────────────────────────┘
  1842. Function        Copies one vector to another.
  1843. Syntax          #include <VFstd.h>
  1844.                 void VF_equV(  fVector Y, fVector X, ui size );
  1845.                 void VFx_equV( fVector Y, fVector X,  ui size,
  1846.                                float A,  float B );
  1847. Description     normal versions:     Yi = Xi
  1848.                 expanded versions:   Yi = A * Xi + B
  1849. Error handling  none
  1850. Return value    none
  1851. See also        VF_equ0, VF_equ1, VF_equC,  memcpy, memmove, movmem
  1852.  
  1853.  
  1854. ┌────────────────────────────────────────────────────────────────────────────┐
  1855. │ VF_Euclid                VD_Euclid                VE_Euclid                │
  1856. └────────────────────────────────────────────────────────────────────────────┘
  1857. Function        Calculates the Euclidean norm of a vector
  1858. Syntax          #include <VFstd.h>
  1859.                 float VF_Euclid( fVector X, ui size );
  1860. Description     norm  =  sqrt(  sum( Xi² ) )
  1861.                 The Euclidean norm of a vector is defined as the square-root
  1862.                 of the scalar product of the vector with itself.
  1863. Error handling  none  (but beware of a possible overflow!)
  1864. Return value    The Euclidean norm is returned
  1865. See also        VF_ssq, VF_rms, VF_scalprod, VF_xprod
  1866.  
  1867.  
  1868. ┌────────────────────────────────────────────────────────────────────────────┐
  1869. │ VF_exp                   VD_exp                   VE_exp                   │
  1870. │ VCF_exp                  VCD_exp                  VCE_exp                  │
  1871. │ VFx_exp                  VDx_exp                  VEx_exp                  │
  1872. │ VCFx_exp                 VCDx_exp                 VCEx_exp                 │
  1873. └────────────────────────────────────────────────────────────────────────────┘
  1874. Function        Exponential function
  1875. Syntax          #include <VFmath.h>
  1876.                 int  VF_exp(   fVector  Y,  fVector  X, ui size );
  1877.                 int  VFx_exp(  fVector  Y,  fVector  X, ui size,
  1878.                                float A, float B, float C );
  1879. Description     normal versions:    Yi  =  exp( Xi )
  1880.                 expanded versions:  Yi  =  C *  exp( A*Xi+B )
  1881.                 Euler's constant e is raised to the Xi'th power.  Variants of
  1882.                 the exponential function, like its complement (VF_expc), the
  1883.                 hyperbolic functions (e.g. VF_sinh) or the Gaussian
  1884.                 distribution (VF_Gauss) are also available; see chapter 4.6.6
  1885.                 about "Exponentials" before using VF_exp for sums or other
  1886.                 combinations of exponentials - maybe the desired function
  1887.                 already exists.
  1888. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  1889. Return value    0, if no error occurred, otherwise non-zero
  1890. See also        VF_log,  VF_expc, VF_pow,  VF_sinh,  VF_exp2,  VF_Gauss,  exp
  1891.  
  1892.  
  1893. ┌────────────────────────────────────────────────────────────────────────────┐
  1894. │ VF_exp2                  VD_exp2                  VE_exp2                  │
  1895. │ VFx_exp2                 VDx_exp2                 VEx_exp2                 │
  1896. └────────────────────────────────────────────────────────────────────────────┘
  1897. Function        Exponential function to the basis 2
  1898. Syntax          #include <VFmath.h>
  1899.                 int  VF_exp2(   fVector  Y,  fVector  X, ui size );
  1900.                 int  VFx_exp2(  fVector  Y,  fVector  X, ui size,
  1901.                                 float A, float B, float C );
  1902. Description     normal versions:    Yi  =  2 ** Xi
  1903.                 expanded versions:  Yi  =  C *  2 ** ( A*Xi+B )
  1904.                 Two is raised to the Xi'th power. These function names
  1905.                 are used as synonyms for VF_pow2 etc.
  1906. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  1907. Return value    0, if no error occurred, otherwise non-zero
  1908. See also        VF_exp, VF_exp10, VF_ipow2, VF_scale2, VF_log2
  1909.  
  1910.  
  1911. ┌────────────────────────────────────────────────────────────────────────────┐
  1912. │ VF_exp10                 VD_exp10                 VE_exp10                 │
  1913. │ VFx_exp10                VDx_exp10                VEx_exp10                │
  1914. └────────────────────────────────────────────────────────────────────────────┘
  1915. Function        Exponential function to the basis 10
  1916. Syntax          #include <VFmath.h>
  1917.                 int  VF_exp10(   fVector  Y,  fVector  X, ui size );
  1918.                 int  VFx_exp10(  fVector  Y,  fVector  X, ui size,
  1919.                                  float A, float B, float C );
  1920. Description     normal versions:    Yi  =  10 ** Xi
  1921.                 expanded versions:  Yi  =  C *  10 ** ( A*Xi+B )
  1922.                 Ten is raised to the Xi'th power. These function names
  1923.                 are used as synonyms for VF_pow10 etc.
  1924. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  1925. Return value    0, if no error occurred, otherwise non-zero
  1926. See also        VF_exp, VF_exp2, VF_ipow10, VF_scale10, VF_log10
  1927.  
  1928.  
  1929. ┌────────────────────────────────────────────────────────────────────────────┐
  1930. │ VF_expArbBase            VD_expArbBase            VE_expArbBase            │
  1931. │ VCF_expArbBase           VCD_expArbBase           VCE_expArbBase           │
  1932. │ VFx_expArbBase           VDx_expArbBase           VEx_expArbBase           │
  1933. │ VCFx_expArbBase          VCDx_expArbBase          VCEx_expArbBase          │
  1934. └────────────────────────────────────────────────────────────────────────────┘
  1935. Function        Exponential function of an arbitrary base
  1936. Syntax          #include <VFmath.h>
  1937.                 int  VF_expArbBase(   fVector  Y,  fVector  X, ui size,
  1938.                                       float Base );
  1939.                 int  VFx_expArbBase(  fVector  Y,  fVector  X, ui size,
  1940.                                       float Base, float A, float B, float C );
  1941. Description     normal versions:    Yi  =  Base ** Xi
  1942.                 expanded versions:  Yi  =  C *  Base ** ( A*Xi+B )
  1943.                 Base must be positive and non-zero in the real-number
  1944.                 versions. In the complex versions, Base must be non-zero.
  1945. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  1946. Return value    0, if no error occurred, otherwise non-zero
  1947. See also        VF_exp, VF_pow
  1948.  
  1949.  
  1950. ┌────────────────────────────────────────────────────────────────────────────┐
  1951. │ VF_expc                  VD_expc                  VE_expc                  │
  1952. │ VFx_expc                 VDx_expc                 VEx_expc                 │
  1953. └────────────────────────────────────────────────────────────────────────────┘
  1954. Function        Calculate the "complementary exponential function" of each
  1955.                 element of a vector.
  1956. Syntax          #include <VFmath.h>
  1957.                 int  VF_expc(  fVector  Y,  fVector  X, ui size );
  1958.                 int  VFx_expc( fVector  Y,  fVector  X, ui size,
  1959.                                float A, float B, float C );
  1960. Description     normal versions:    Yi  =  1  -  exp( Xi )
  1961.                 expanded versions:  Yi  =  C * (1 - exp [A*Xi + B ])
  1962.                 The difference between 1.0 and the exponential function of Xi
  1963.                 is calculated. Note that the expc function is directly
  1964.                 available from the 80x87 coprocessor in high accuracy; in
  1965.                 fact, it is the exponential function itself that is internally
  1966.                 calculated via the expc function. The expc function is often
  1967.                 encountered in the natural sciences for the description of
  1968.                 decay and growth processes.
  1969. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  1970. Return value    0, if no error occurred, otherwise non-zero.
  1971. See also        VF_log,  VF_exp, VF_pow,  VF_sinh,  VF_exp2,  VF_Gauss,  exp
  1972.  
  1973.  
  1974. ┌────────────────────────────────────────────────────────────────────────────┐
  1975. │ VF_expmx2                VD_expmx2                VE_expmx2                │
  1976. │ VFx_expmx2               VDx_expmx2               VEx_expmx2               │
  1977. └────────────────────────────────────────────────────────────────────────────┘
  1978. Function        Exponential function of the negative square of the argument
  1979. Syntax          #include <VFmath.h>
  1980.                 int  VF_expmx2(  fVector  Y,  fVector  X, ui size );
  1981.                 int  VFx_expmx2( fVector  Y,  fVector  X, ui size,
  1982.                                float A, float B, float C );
  1983. Description     normal versions:     Yi  =  exp( -Xi² )
  1984.                 expanded versions:   Yi  =  C * exp( -(A*Xi+B)² )
  1985.                 This function yields a bell-shaped curve similar to the
  1986.                 Gaussian function.
  1987. Error handling  This function should be error-proof.
  1988. Return value    always 0
  1989. See also        VF_log,  VF_exp,  VF_Gauss,  VF_sech2,  VF_Lorentz,  exp
  1990.  
  1991.  
  1992. ┌────────────────────────────────────────────────────────────────────────────┐
  1993. │ VF_FFT                   VD_FFT                   VE_FFT                   │
  1994. │ VCF_FFT                  VCD_FFT                  VCE_FFT                  │
  1995. └────────────────────────────────────────────────────────────────────────────┘
  1996. Function        Fast Fourier transform
  1997. Syntax          #include <VFstd.h>
  1998.                 void VF_FFT(  fVector Y, fVector X, ui size, int dir );
  1999. Description     The Fourier transform of X is calculated and stored in Y. The
  2000.                 forward transform is obtained by setting dir = 1,  the inverse
  2001.                 (or backward) transform by setting dir = -1.  A Fast Fourier
  2002.                 Transform algorithm is used that requires size to be a power
  2003.                 of 2.
  2004.                 Complex version: Both X and the output Y are complex vectors.
  2005.                 Real version:  For the forward transform, X is a real vector.
  2006.                 The output Y is also defined as fVector, although it consists
  2007.                 of complex numbers. These are packed in a special way such
  2008.                 as to fit into the same amount of memory as the original
  2009.                 real vector X. The order of storage in Y is indicated in the
  2010.                 following table (N=size, U is the uncompressed Fourier
  2011.                 Transform of X):
  2012.  
  2013. ┌─────────┬───────────┬─────────┬─────────┬────────┬────────────┬────────────┐
  2014. │  Y[0]   │   Y[1]    │    Y[2] │   Y[3]  │ .......│   Y[N-2]   │    Y[N-1]  │
  2015. ├─────────┼───────────┼─────────┼─────────┼────────┼────────────┼────────────┤
  2016. │ U[0].Re │ U[N/2].Re │ U[1].Re │ U[1].Im │ .......│ U[N/2-1].Re│ U[N/2-1].Im│
  2017. └─────────┴───────────┴─────────┴─────────┴────────┴────────────┴────────────┘
  2018.                 The reason for this packing is the following. If the size real
  2019.                 data points of X represent a function of the time, X = g(t),
  2020.                 then the forward transform yields a function U = G(f) in the
  2021.                 frequency domain. In principle, U consists of size+1 complex
  2022.                 data points:  size/2 points for positive frequencies, another
  2023.                 size/2 points for negative frequencies, and one point at
  2024.                 frequency zero.
  2025.                 For the Fourier Transform of a real vector, the symmetry
  2026.                 relation G(-f) = │G(f)│*  holds (the asterisc denoting the
  2027.                 complex conjugate). This means that the points at
  2028.                 negative frequencies need not be stored; all information is
  2029.                 already contained in the positive frequency half. Moreover,
  2030.                 the zeroth and the size2'th element of the transform are both
  2031.                 purely real.  Therefore, only these two real and size/2-1
  2032.                 complex data points have to be stored - which exactly fit
  2033.                 into the same amount of memory as the original size real data
  2034.                 points of X. This allows X to be overwritten by its transform,
  2035.                 if desired.
  2036.  
  2037.                 In cases where it is more convenient to obtain the unpacked
  2038.                 complex vector, the following sequence should to be used:
  2039.                    Y = VCF_vector0( size );
  2040.                          /* create Y as a zeroed complex Vector */
  2041.                    VF_RetoC( Y, X, size );
  2042.                          /* Y.Re = X, Y.Im remains zero */
  2043.                    VCF_FFT( Y, Y, size, 1 ) ;       /*  transform Y  */
  2044.  
  2045.                 For the real version of the inverse transform, X has to be a
  2046.                 complex vector packed in the way just described, and a real-
  2047.                 valued vector Y is obtained.
  2048.  
  2049.                 About special versions with the prefixes  VFs_  and VFl_,
  2050.                 consult chapter 4.8.
  2051. Error handling  If size is not a power of 2,  an error message "Size must be
  2052.                 an integer power of 2" is generated and the program aborted.
  2053. Return value    none
  2054. See also        VF_filter, VF_convolve, VF_autocorr, VF_xcorr, VF_spectrum
  2055.  
  2056.  
  2057. ┌────────────────────────────────────────────────────────────────────────────┐
  2058. │ VF_filter                VD_filter                VE_filter                │
  2059. │ VCF_filter               VCD_filter               VCE_filter               │
  2060. └────────────────────────────────────────────────────────────────────────────┘
  2061. Function        Frequency filtering
  2062. Syntax          #include <VFstd.h>
  2063.                 void VF_filter(    fVector Y,  fVector X,
  2064.                                 fVector Flt,  ui size );
  2065. Description     A frequency filter Flt is applied to the vector X. Internally,
  2066.                 this is done by performing a Fourier transform on X,
  2067.                 multiplying the transform with Flt and transforming the
  2068.                 product back into the time domain.
  2069.  
  2070.                 Complex versions: X, Y and the filter Flt are complex vectors.
  2071.                 Real versions:   X and Y are real.  Flt has to be in the
  2072.                 packed complex format that is obtained by Fourier transforming
  2073.                 a real vector with VF_FFT (see that function for the
  2074.                 description of the packed complex format) or by using
  2075.                 VF_convolve.
  2076.  
  2077.                 If X is non-periodic, both ends of the filtered function may
  2078.                 be spoiled by wrap-around. See VF_convolve about how to avoid
  2079.                 end-effects by embedding X in a larger vector or by removing
  2080.                 a possible linear trend.
  2081.                 About special versions with the prefixes  VFs_  and VFl_,
  2082.                 consult chapter 4.8.
  2083. Error handling  If size is not a power of 2,  VF_FFT  (on which VF_filter
  2084.                 is based) complains "Size must be an integer power of 2"
  2085.                 and the program is aborted.
  2086. Return value    none
  2087. See also        VF_FFT, VF_convolve, VF_autocorr, VF_xcorr, VF_spectrum
  2088.  
  2089.  
  2090. ┌────────────────────────────────────────────────────────────────────────────┐
  2091. │ V_findAxes                                                                 │
  2092. └────────────────────────────────────────────────────────────────────────────┘
  2093. Function        Calculate an appropriate scaling and draw a Cartesian
  2094.                 coordinate system.
  2095. Syntax          #include <Vgraph.h>
  2096.                 void V_findAxes( long double Xmin, long double Xmax,
  2097.                                  long double Ymin, long double Ymax );
  2098. Description     This function will rarely be called by the user, but is used
  2099.                 internally in VF_xyAutoPlot and other plotting functions.
  2100.                 According to the x- and y ranges given in the parameters Xmin,
  2101.                 Xmax, Ymin and Ymax, a linear Cartesian coordinate system is
  2102.                 drawn with ten subdivisions both for the  abscissa and the
  2103.                 ordinate. If necessary, the x and y ranges are enlarged so as
  2104.                 to meet the following conditions:
  2105.                 1.  Every subdivision line represents an exact (and not
  2106.                     only a rounded) value.
  2107.                 2.  If the range of one axis or both includes zero, zero
  2108.                     falls exactly on a subdivision line.
  2109.  
  2110.                 If the automatic scaling is not desired, use V_drawAxes
  2111.                 instead.
  2112.                 Before calling V_findAxes, the plotting routines have to be
  2113.                 initialized by either V_initGraph or V_initPlot.
  2114. Error handling  none
  2115. Return value    none
  2116. See also        V_drawAxes, V_initPlot, VF_xyAutoPlot
  2117.  
  2118.  
  2119. ┌────────────────────────────────────────────────────────────────────────────┐
  2120. │ VF_floor                 VD_floor                 VE_floor                 │
  2121. │ VF_floortoI              VD_floortoI              VE_floortoI              │
  2122. │ VF_floortoSI             VD_floortoSI             VE_floortoSI             │
  2123. │ VF_floortoLI             VD_floortoLI             VE_floortoLI             │
  2124. │ VF_floortoQI             VD_floortoQI             VE_floortoQI             │
  2125. │ VF_floortoU              VD_floortoU              VE_floortoU              │
  2126. │ VF_floortoUS             VD_floortoUS             VE_floortoUS             │
  2127. │ VF_floortoUL             VD_floortoUL             VE_floortoUL             │
  2128. │ VF_floortoUI             VD_floortoUI             VE_floortoUI             │
  2129. └────────────────────────────────────────────────────────────────────────────┘
  2130. Function        Rounding towards minus infinity
  2131. Syntax          #include <VFmath.h>
  2132.                 int VF_floor(     fVector Y,   fVector X,  ui size );
  2133.                 int VF_floortoI(  iVector Y,   fVector X,  ui size );
  2134.                 int VF_floortoLI( liVector Y, fVector X,  ui size );
  2135.                 int VF_floortoU(  uVector Y, fVector X,  ui size );
  2136.                      (similarly  all others)
  2137. Description     Each element of X is rounded to the nearest whole number that
  2138.                 is less than or equal to the input number and the result
  2139.                 stored in Y. The functions VF_floortoI, VF_floortoLI,
  2140.                 VF_floortoU, etc. convert the result to the various integer
  2141.                 data types (in the cases mentioned, to the types int,  long
  2142.                 int, or unsigned, respectively).
  2143. Error handling  OVERFLOW errors are handled by setting the result to the
  2144.                 extreme value possible. Negative numbers in the versions
  2145.                 VF_floortoU, VF_floortoUS, VF_floortoUL, and VF_floortoUI
  2146.                 lead to DOMAIN errors; they are handled by setting the result
  2147.                 to 0.
  2148. Return value    0, if no error occurred, otherwise non-zero.
  2149. See also        ceil, floor, VF_round,  VF_ceil, VF_chop, VF_trunc
  2150.  
  2151.  
  2152. ┌────────────────────────────────────────────────────────────────────────────┐
  2153. │ VF_flush0                VD_flush0                VE_flush0                │
  2154. │ VCF_flush0               VCD_flush0               VCE_flush0               │
  2155. └────────────────────────────────────────────────────────────────────────────┘
  2156. Function        Sets vector elements with an absolute value less than a
  2157.                 certain threshold to 0.
  2158. Syntax          #include <VFmath.h>
  2159.                 void  VF_flush0(  fVector Y,  fVector X,  ui size,
  2160.                                   float  AbsMin );
  2161.                 void  VCF_flush0( fVector Y,  fVector X,  ui size,
  2162.                                   fComplex  AbsMin );
  2163. Description     Yi  =  Xi,   if  │ Xi │  >=  AbsMin,
  2164.                 Yi  =  0,    otherwise
  2165.                 The complex versions treat the real and imaginary parts
  2166.                 separately, using the real and imaginary parts of AbsMin to
  2167.                 determine where to cut. If only the imaginary part is to be
  2168.                 edited, set the real part of AbsMin to zero, e.g.:
  2169.                    VCF_flush0( Y, X, size, fcplx( 0, 1.e-6 ));
  2170. Error handling  none
  2171. Return value    none
  2172. See also        VF_limit,  VF_maxC
  2173.  
  2174.  
  2175. ┌────────────────────────────────────────────────────────────────────────────┐
  2176. │ VF_fmodC                 VD_fmodC                 VE_fmodC                 │
  2177. │ VF_fmodV                 VD_fmodV                 VE_fmodV                 │
  2178. │ VFx_fmodV                VDx_fmodV                VEx_fmodV                │
  2179. └────────────────────────────────────────────────────────────────────────────┘
  2180. Function        Floating-point modulo division
  2181. Syntax          #include <VFmath.h>
  2182.                 void VF_fmodC( fVector Y, fVector X, ui size, float C );
  2183.                 void VF_fmodV( fVector Z, fVector X, fVector Y, ui size );
  2184.                 void VFx_fmodV( fVector Z,  fVector X, fVector Y,
  2185.                                 ui size, float A, float B );
  2186. Description     These functions have been included in order to provide
  2187.                 consistency with ANSI C function names. They are implemented
  2188.                 as macros that call VF_modC, VF_modV,  VFx_modV etc.  See
  2189.                 these functions for details.
  2190.  
  2191.  
  2192. ┌────────────────────────────────────────────────────────────────────────────┐
  2193. │ VF_fprint                VD_fprint                VE_fprint                │
  2194. │ VCF_fprint               VCD_fprint               VCE_fprint               │
  2195. │ VI_fprint           VSI_fprint          VLI_fprint          VQI_fprint     │
  2196. │ VU_fprint           VUS_fprint          VUL_fprint          VUI_fprint     │
  2197. └────────────────────────────────────────────────────────────────────────────┘
  2198. Function        print a vector to a stream
  2199. Syntax          #include <VFstd.h>
  2200.                 VF_fprint( FILE *stream, fVector X, ui size,
  2201.                            unsigned nperline, unsigned linewidth );
  2202. Description     size elements of X are written to stream,  nperline in each
  2203.                 line of linewidth characters.
  2204.  
  2205.                 Printing starts always with a new line. This may lead to
  2206.                 an empty line at the beginning. Especially the first line
  2207.                 of a file is reserved for a possible headline.
  2208.  
  2209.                 Each line begins with the index of the first element printed
  2210.                 into that line. The index is followed by a colon and by
  2211.                 the requested nperline elements.
  2212.                 Complex numbers are printed in braces, with the real and
  2213.                 imaginary parts separated by a komma:   {Re, Im}.
  2214.  
  2215.                 In contrast to VF_write and VF_nwrite, it is not possible
  2216.                 to override the automatic choice of the format used for
  2217.                 printing. The number of digits per element is determined
  2218.                 by the available space, which depends in turn on the
  2219.                 parameters nperline and linewidth.
  2220. Error handling  if nperline exceeds the maximum number of entries possible for
  2221.                 the linewidth chosen, an error message "Cannot use requested
  2222.                 format (too many entries per line)!" is generated; in this
  2223.                 case, the program chooses the maximum number nperline
  2224.                 possible.
  2225. Return value    none
  2226. See also        fprintf, VF_cprint, VF_print, VF_write, VF_store
  2227.  
  2228.  
  2229. ┌────────────────────────────────────────────────────────────────────────────┐
  2230. │ V_free                                                                     │
  2231. └────────────────────────────────────────────────────────────────────────────┘
  2232. Function        De-allocate a single vector
  2233. Syntax          #include <VecLib.h>
  2234.                 void  V_free(  void *X );
  2235. Description     The vector X is freed (i.e. de-allocated). V_free  should be
  2236.                 used only for the de-allocation of vectors which have
  2237.                 previously be allocated by one of the functions of the
  2238.                 VF_vector or VF_vector0  family. To free several vectors
  2239.                 simultaneously, use V_nfree.
  2240. Error handling  Trying to free a vector that has already been freed, or that
  2241.                 has never been allocated memory, leads to a warning message
  2242.                 "Cannot free non-existent vector". Program execution is
  2243.                 continued without freeing anything in this case.
  2244. Return value    none
  2245. See also        V_nfree,  V_freeAll, VF_vector,  VF_vector0
  2246.  
  2247.  
  2248. ┌────────────────────────────────────────────────────────────────────────────┐
  2249. │ V_freeAll                                                                  │
  2250. └────────────────────────────────────────────────────────────────────────────┘
  2251. Function        De-allocate all vectors
  2252. Syntax          #include <VecLib.h>
  2253.                 void  V_freeAll(  void );
  2254. Description     All vectors previously be allocated by one of the functions
  2255.                 of the VF_vector or VF_vector0  families are freed.
  2256. Error handling  none
  2257. Return value    none
  2258. See also        V_free,  V_nfree, VF_vector,  VF_vector0
  2259.  
  2260.  
  2261. ┌────────────────────────────────────────────────────────────────────────────┐
  2262. │ VF_frexp                 VD_frexp                VE_frexp                  │
  2263. └────────────────────────────────────────────────────────────────────────────┘
  2264. Function        Split up the elements of a vector into their mantissa and
  2265.                 exponent parts.
  2266. Syntax          #include <VFmath.h>
  2267.                 int  VF_frexp( fVector Mant, iVector Exp, fVector X,
  2268.                                ui size );
  2269. Description     The function is implemented as a macro calling VF_mantexp; the
  2270.                 name VF_frexp is included only to maintain consistency with
  2271.                 the ANSI C function name frexp. For details, see VF_mantexp
  2272.                 and frexp.
  2273.  
  2274.  
  2275. ┌────────────────────────────────────────────────────────────────────────────┐
  2276. │ V_FtoD              V_FtoE              V_CFtoCD            V_CFtoCE       │
  2277. │ V_DtoF              V_DtoE              V_CDtoCF            V_CDtoCE       │
  2278. │ V_EtoF              V_EtoD              V_CEtoCF            V_CEtoCD       │
  2279. └────────────────────────────────────────────────────────────────────────────┘
  2280. Function        Data type interconversions.
  2281. Syntax          #include <VDstd.h>
  2282.                      (always include the <V..std.h>  file of the destination
  2283.                       data-type!)
  2284.                 void V_FtoD(  dVector Y,  fVector X, ui size );
  2285.                      (similarly all other functions of this family)
  2286. Description     Each element of X is converted from the data type specified
  2287.                 for X to the data type specified for Y and stored in Y.
  2288. Error handling  floating-point versions: OVERFLOW errors may occur in the
  2289.                 course of the "down-conversions" (e.g., V_EtoF); by default,
  2290.                 the extreme value possible for the destination data type is
  2291.                 stored in Y with the correct sign. The occurrence of errors
  2292.                 may be excluded by calling VE_limit or VD_limit (whichever
  2293.                 is appropriate) prior to performing the data type conversion.
  2294. Return value    none
  2295. See also        VF_limit, V_ItoF, V_roundtoI, V_roundtoLI
  2296.  
  2297.  
  2298. ┌────────────────────────────────────────────────────────────────────────────┐
  2299. │ VF_Gauss                 VD_Gauss                 VE_Gauss                 │
  2300. └────────────────────────────────────────────────────────────────────────────┘
  2301. Function        Gaussian normal distribution function.
  2302. Syntax          #include <VFmath.h>
  2303.                 int  VF_Gauss( fVector  Y,  fVector  X, ui size,
  2304.                                float Wid,  float Cent, float C );
  2305. Description     Yi   = C / (Wid * sqrt(2*Pi)) * exp( -0.5*((Xi-Cent) / Wid)² )
  2306.                 Wid  =  width of the distribution
  2307.                 Cent =  center of the distribution
  2308.                 C is a scaling factor; for C = 1.0, the distribution is
  2309.                 normalized.
  2310.                 For Wid = 0, the normal distribution is in fact a delta
  2311.                 distribution with Y = C * INF  at X = Cent  and Y = 0 at
  2312.                 all other values of X.
  2313.                 Since infinities are not supported, the existence of a point
  2314.                 X = Cent will lead to a SING error  in case Wid is zero.
  2315. Error handling  SING errors may occur only for a Wid of zero. They are
  2316.                 handled with the default result set to ±HUGE_VAL.
  2317. Return value    0, if no error occurred, otherwise non-zero.
  2318. See also        VF_exp,  VF_sech2,  VF_Lorentz,  exp
  2319.  
  2320.  
  2321. ┌────────────────────────────────────────────────────────────────────────────┐
  2322. │ V_getCoordSystem                                                           │
  2323. └────────────────────────────────────────────────────────────────────────────┘
  2324. Function        Store the scalings and position of the current coordinate
  2325.                 system used for VectorLib plotting operations
  2326. Syntax          #include <Vgraph.h>
  2327.                 void V_getCoordSystem( VCOORDSYSTEM *csys );
  2328. Description     If one wants to "hop" between several coordinate systems,
  2329.                 displayed in one and the same window, one has to store the
  2330.                 specifications (position and scalings) of each coordinate
  2331.                 system separately, using this function. 
  2332.                 The address of a struct VCOORDSYSTEM is needed as the
  2333.                 argument. VCOORDSYSTEM is defined in <Vgraph.h>.
  2334. Example         VCOORDSYSTEM csys1;
  2335.                    ....
  2336.                   /* create the first plot:  */
  2337.                 V_setPlotRegion( 0, 0, 339, 200 );
  2338.                 VF_xyAutoPlot( X1, Y1, size1, PS_SOLID, LightGreen );
  2339.                 V_getCoordSystem( &csys1 ); /* store for later */
  2340.                    /* create the second plot: */
  2341.                 V_setPlotRegion( 340, 0, 679, 200 );
  2342.                 VF_xyAutoPlot( X2, Y2, size2, PS_SOLID, LightRed );
  2343.                    /* go back to the first plot: */
  2344.                 VF_setCoordSystem( &csys1 );
  2345.                    /* add an additional DataPlot:  */
  2346.                 VF_xyDataPlot( X1, Z1, size1, PS_SOLID, LightBlue );
  2347. Error handling  none
  2348. Return value    none
  2349. See also        V_setCoordSystem, V_setPlotRegion, V_continuePlot
  2350.  
  2351.  
  2352. ┌────────────────────────────────────────────────────────────────────────────┐
  2353. │ VF_getRspEdit            VD_getRspEdit            VE_getRspEdit            │
  2354. └────────────────────────────────────────────────────────────────────────────┘
  2355. Function        Read the present threshold for the editing of the filter in
  2356.                 VF_convolve and VF_deconvolve
  2357. Syntax          #include <VFstd.h>
  2358.                 fComplex  VF_getRspEdit( void );
  2359. Description     The threshold for the treatment of round-off errors in the
  2360.                 functions for convolution and deconvolution is returned.
  2361. Error handling  none
  2362. Return value    present threshold.
  2363.                 real part:      acts on the real parts of the filter elements
  2364.                 imaginary part: acts on the imaginary parts of the filter
  2365.                                 elements
  2366. See also        VF_setRspEdit,  VF_convolve,  VF_deconvolve
  2367.  
  2368.  
  2369. ┌────────────────────────────────────────────────────────────────────────────┐
  2370. │ VF_Hanning               VD_Hanning               VE_Hanning               │
  2371. └────────────────────────────────────────────────────────────────────────────┘
  2372. Function        "Hanning" window for use in spectral analysis
  2373. Syntax          #include <VFstd.h>
  2374.                 void VF_Hanning( fVector X, ui size );
  2375. Description     Xi = 0.5 * (1 - cos( 2 Pi i / (size-1) ))
  2376. Error handling  none
  2377. Return value    none
  2378. See also        VF_Welch, VF_Parzen, VF_spectrum
  2379.  
  2380.  
  2381. ┌────────────────────────────────────────────────────────────────────────────┐
  2382. │ VF_hypC                  VD_hypC                  VE_hypC                  │
  2383. └────────────────────────────────────────────────────────────────────────────┘
  2384. Function        Quotient of Xi over the sum of Xi and a constant.
  2385. Syntax          #include <VFmath.h>
  2386.                 void VF_hypC( fVector Y, fVector X, ui size, float C );
  2387. Description     Yi  =  hyp( Xi, C )  =  Xi / (Xi + C)
  2388.                 The function calculating Yi according to this formula is
  2389.                 dubbed "hyp" for its formal similarity to the expression
  2390.                 constructing a hyperbola.
  2391. Error handling  none
  2392. Return value    none
  2393. See also        VF_hypV, VF_redC,  VF_addC,  VF_subC,  VF_divC,  VF_visC
  2394.  
  2395.  
  2396. ┌────────────────────────────────────────────────────────────────────────────┐
  2397. │ VF_hypV                  VD_hypV                  VE_hypV,                 │
  2398. │ VFx_hypV                 VDx_hypV                 VEx_hypV                 │
  2399. └────────────────────────────────────────────────────────────────────────────┘
  2400. Function        Quotient of Xi over the sum of Xi and Yi
  2401. Syntax          #include <VFmath.h>
  2402.                 void  VF_hypV( fVector  Z, fVector  X, fVector  Y, ui size );
  2403.                 void  VFx_hypV( fVector  Z,  fVector  X,  fVector  Y,
  2404.                                 ui size, float  A,  float  B );
  2405. Description     normal versions:     Zi = hyp( Xi, Yi ) = Xi / (Xi + Yi)
  2406.                 expanded versions:   Zi = hyp( A*Xi+B), Yi )
  2407. Error handling  none
  2408. Return value    none
  2409. See also        VF_hypC,  VF_redV,  VF_addV,  VF_subV,  VF_divV,  VF_visV
  2410.  
  2411.  
  2412. ┌────────────────────────────────────────────────────────────────────────────┐
  2413. │ VF_hypotC                VD_hypotC                VE_hypotC                │
  2414. └────────────────────────────────────────────────────────────────────────────┘
  2415. Function        Pythagoras "hypotenuse" function.
  2416. Syntax          #include <VFmath.h>
  2417.                 int  VF_hypotC( fVector Y,  fVector X,  ui size, float C );
  2418. Description     Yi =  sqrt( Xi² + C² )
  2419.                 This is a variant of the famous Pythagorean theorem for the
  2420.                 hypotenuse of a right triangle.
  2421. Error handling  OVERFLOW errors lead to a default result of HUGE_VAL. Unlike
  2422.                 the treatment of the ANSI C function hypot by several com-
  2423.                 pilers, only an overflowing final result is regarded as an
  2424.                 error. Intermediate overflows (by the calculation of the
  2425.                 square) are avoided by appropriate scaling.
  2426. Return value    0, if no error occurred;  otherwise non-zero.
  2427. See also        VF_hypotV,  VF_redC,  VF_visC,  VCF_abs, hypot
  2428.  
  2429.  
  2430. ┌────────────────────────────────────────────────────────────────────────────┐
  2431. │ VF_hypotV                VD_hypotV                VE_hypotV                │
  2432. │ VFx_hypotV               VDx_hypotV               VEx_hypotV               │                    │
  2433. └────────────────────────────────────────────────────────────────────────────┘
  2434. Function        Pythagoras "hypotenuse" function.
  2435. Syntax          #include <VFmath.h>
  2436.                 int  VF_hypotV(  fVector Z, fVector X, fVector Y, ui size );
  2437.                 int  VFx_hypotV( fVector Z, fVector X, fVector Y,
  2438.                                  ui size,  float A,  float B );
  2439. Description     normal version:    Yi =  sqrt( Xi² + Yi² )
  2440.                 expanded version:  Yi =  sqrt( (A*Xi+B)² + Yi² )
  2441.                 These are variants of the Pythagoras formula for the
  2442.                 hypotenuse of a right triangle.
  2443. Error handling  OVERFLOW errors lead to a default result of HUGE_VAL.
  2444.                 (Intermediate overflows are avoided by appropriate scaling.)
  2445. Return value    0, if no error occurred;  otherwise non-zero.
  2446. See also        VF_redC,  VF_visC,  VCF_abs, hypot
  2447.  
  2448.  
  2449. ┌────────────────────────────────────────────────────────────────────────────┐
  2450. │ VCF_imag                 VCD_imag                 VCE_imag                 │
  2451. └────────────────────────────────────────────────────────────────────────────┘
  2452. Function        Extracts the imaginary part from a complex vector. Implemented
  2453.                 as a macro that calls VF_CtoIm, VD_CtoIm, VE_CtoIm, resp.  See
  2454.                 these functions for details.
  2455.  
  2456.  
  2457. ┌────────────────────────────────────────────────────────────────────────────┐
  2458. │ VF_ImtoC                 VD_ImtoC                 VE_ImtoC                 │
  2459. └────────────────────────────────────────────────────────────────────────────┘
  2460. Function        Overwrites the imaginary part of a complex vector with a real-
  2461.                 valued vector.
  2462. Syntax          #include <VCFstd.h>
  2463.                 void VF_ImtoC( cfVector Y, fVector Im, ui size );
  2464. Description     The imaginary part of the complex vector Y is overwritten with
  2465.                 the elements of the real-valued vector Im. The real part of Y
  2466.                 is not affected.
  2467. Error handling  none
  2468. Return value    none
  2469. See also        VF_CtoReIm, VF_ReImtoC,  VF_RetoC,  VF_CtoIm, VF_PolartoC
  2470.  
  2471.  
  2472. ┌────────────────────────────────────────────────────────────────────────────┐
  2473. │ VF_indpick               VD_indpick               VE_indpick               │
  2474. │ VCF_indpick              VCD_indpick              VCE_indpick              │
  2475. │ VI_indpick          VSI_indpick         VLI_indpick         VQI_indpick    │
  2476. │ VU_indpick          VUS_indpick         VUL_indpick         VUI_indpick    │
  2477. └────────────────────────────────────────────────────────────────────────────┘
  2478. Function        Fill a vector with elements "picked" from another one
  2479.                 according to their indices.
  2480. Syntax          #include <VFstd.h>
  2481.                 void  VF_indpick( fVector Y, uiVector Ind, ui size,
  2482.                                   fVector X );
  2483. Description     Y[i] = X[ Ind[i] ],               i=0,..size-1
  2484.                 The vector Y is filled with size elements taken from X
  2485.                 according to their indices specified in Ind. The parameter
  2486.                 size refers to Y and Ind. The size of X is unimportant, as
  2487.                 long as the elements specified in Ind exist.
  2488. Error handling  none
  2489. Return value    none
  2490. See also        VF_indput, VF_subvector, VF_sortind
  2491.  
  2492.  
  2493. ┌────────────────────────────────────────────────────────────────────────────┐
  2494. │ VF_indput                VD_indput                VE_indput                │
  2495. │ VCF_indput               VCD_indput               VCE_indput               │
  2496. │ VI_indput           VSI_indput          VLI_indput          VQI_indput     │
  2497. │ VU_indput           VUS_indput          VUL_indput          VUI_indput     │
  2498. └────────────────────────────────────────────────────────────────────────────┘
  2499. Function        Distribute the elements of one vector to the places within
  2500.                 another vector specified by their indices.
  2501. Syntax          #include <VFstd.h>
  2502.                 void  VF_indput( fVector Y, fVector X, uiVector Ind,
  2503.                                  ui sizex );
  2504. Description     Y[ Ind[i] ] = X[i],               i=0,..sizex-1
  2505.                 The sizex elements of X are put into the places of Y accor-
  2506.                 ding to the indices specified in Ind. The parameter
  2507.                 sizex refers to X and Ind. The size of Y is unimportant, as
  2508.                 long as the elements specified in Ind exist.
  2509. Error handling  none
  2510. Return value    none
  2511. See also        VF_indpick, VF_subvector, VF_sortind
  2512.  
  2513.  
  2514. ┌────────────────────────────────────────────────────────────────────────────┐
  2515. │ V_initGraph                                                                │
  2516. └────────────────────────────────────────────────────────────────────────────┘
  2517. Function        Initializes Borland's graphics system and the plotting
  2518.                 functions of the VectorLib library  (DOS only).
  2519. Syntax          #include <Vgraph.h>
  2520.                 void V_initGraph( char *pathtodriver );
  2521. Description     In DOS programs, this function is used to initialize Borland's
  2522.                 graphics system by calling Borland's function initgraph and to
  2523.                 initialize the VectorLib plotting functions (by internally
  2524.                 calling V_initPlot). The search-path for graphics driver
  2525.                 files has to be passed as a pointer to the string pathtodriver
  2526.                 (see initgraph for details). The function uses initgraph to
  2527.                 automatically detect the graphics driver present. This
  2528.                 automatic detection ensures that programs may run on different
  2529.                 PC systems without changes in the source code. If, however, it
  2530.                 causes problems or for other reasons is not desired, do not
  2531.                 use V_initGraph (but first initgraph and then V_initPlot). The
  2532.                 global variable V_gmode is set to the graphics mode with the
  2533.                 highest resolution possible for the detected graphics driver.
  2534.                 If initgraph has already been called, do not use V_initGraph,
  2535.                 but call only V_initPlot. Normally, V_initGraph will be called
  2536.                 at the beginning of a program that uses graphics; to switch
  2537.                 back into text mode within the program, use restorecrtmode.
  2538.                 The next call to one of the AutoPlot functions switches again
  2539.                 into graphics mode. You may also do that yourself by using
  2540.                     setgraphmode( V_gmode );
  2541.                 (to do this, the declaration  external int V_gmode;  has to
  2542.                 appear in the module containing this call).
  2543.  
  2544.                 At the end of the program, free the memory allocated for
  2545.                 graphics operations and go back to the standard mode with
  2546.                 closegraph.
  2547.  
  2548.                 Windows programs do not use the BGI routines. Consequently,
  2549.                 BGI initialization is available only under DOS, but not under
  2550.                 Windows.   V_initPlot has to be used in order to prepare the
  2551.                 VectorLib plotting operations under Windows.
  2552. Error handling  In case of failure, grapherrormsg is called, the appropriate
  2553.                 error message displayed and the program aborted.
  2554. Return value    none
  2555. See also        V_initPlot,  initgraph, closegraph, V_setPlotRegion,
  2556.                 VF_xyAutoPlot, VF_yAutoPlot, VF_xyDataPlot, VCF_autoPlot
  2557.  
  2558.  
  2559. ┌────────────────────────────────────────────────────────────────────────────┐
  2560. │ V_initPlot                                                                 │
  2561. └────────────────────────────────────────────────────────────────────────────┘
  2562. Function        Initialize the global variables used by the plotting functions
  2563. Syntax          #include <Vgraph.h>
  2564.                 #ifdef _Windows
  2565.                     void V_initPlot( HWND vwindow,  HDC  vdc );
  2566.                 #else
  2567.                     void V_initPlot( int graphmode );
  2568.                 #endif
  2569. Description     DOS programs:
  2570.                    If the graphics system has been initialized by a call to
  2571.                    initgraph, V_initPlot is used to initialize the global
  2572.                    constants necessary for the operation of the VectorLib
  2573.                    plotting functions like VF_xyAutoPlot. If the graphics
  2574.                    system is not yet initialized, use V_initGraph to
  2575.                    initialize both the basic graphics system and the plotting
  2576.                    functions; a call to V_initPlot is not necessary then.
  2577.                    graphmode is the graphics mode set by initgraph.
  2578.                 Windows programs:
  2579.                    vwindow is the handle for a window and vdc the handle of a
  2580.                    device context. As long as these handles remain valid,
  2581.                    future plotting operations (like VF_xyAutoPlot) will be
  2582.                    directed to the window specified by vwindow and use the
  2583.                    fonts defined in the device context vdc.  Be sure that
  2584.                    vwindow and vdc are still valid when a plotting operation
  2585.                    is performed; if in doubt, call  V_initPlot again.
  2586.                    If you use OWL, the handle of the actual window is always
  2587.                    available as HWindow.
  2588.                 DOS and Windows:
  2589.                    V_initPlot reserves the rightmost about 2/3 of the screen
  2590.                    for following plotting operations, leaving one line empty
  2591.                    at the top of the screen and a few lines at the bottom.
  2592.                    To override this, call V_setPlotRegion after V_initPlot.
  2593. Error handling  none
  2594. Return value    none
  2595. See also        V_initGraph, VF_xyAutoPlot, V_findAxes, V_drawAxes,
  2596.                 V_setPlotRegion, V_initPrint
  2597.  
  2598.  
  2599. ┌────────────────────────────────────────────────────────────────────────────┐
  2600. │ V_initPrint                                                                │
  2601. └────────────────────────────────────────────────────────────────────────────┘
  2602. Function        Initialize VectorLib plotting functions for use with
  2603.                 a printer. Windows only!
  2604. Syntax          #include <Vgraph.h>
  2605.                 void V_initPrint( HDC  printdc );
  2606. Description     This function exists only for Windows. It tells the VectorLib
  2607.                 plotting functions to send their output to the printer context
  2608.                 specified as printdc. By default, one whole page is reserved
  2609.                 for the printout. To change this, call V_setPlotRegion
  2610.                 after V_initPrint.
  2611.                 To switch back to screen output, call V_initPlot.
  2612. Error handling  none
  2613. Return value    none
  2614. See also        V_initPlot, V_setPlotRegion, VF_xyAutoPlot
  2615.  
  2616.  
  2617. ┌────────────────────────────────────────────────────────────────────────────┐
  2618. │ VF_insert                VD_insert                VE_insert                │
  2619. │ VCF_insert               VCD_insert               VCE_insert               │
  2620. │ VI_insert           VSI_insert          VLI_insert          VQI_insert     │
  2621. │ VU_insert           VUS_insert          VUL_insert          VUI_insert     │
  2622. └────────────────────────────────────────────────────────────────────────────┘
  2623. Function        Insert an element into a vector
  2624. Syntax          #include <VFstd.h>
  2625.                 void VF_insert( fVector X, ui size, ui pos, float C );
  2626. Description     This is one of the few functions where the input vector is
  2627.                 changed itself (instead of being mapped onto an output
  2628.                 vector). A new element is inserted at the position pos and has
  2629.                 the value C. Elements before pos are unchanged, elements from
  2630.                 pos on are shifted one position higher; the last element is
  2631.                 lost. (If you wish to save the last element, choose size big
  2632.                 enough to have a dummy element at the end of the vector; now
  2633.                 it will be the dummy that gets lost.)
  2634. Error handling  none
  2635. Return value    none
  2636. See also        VF_delete, VF_rotate
  2637.  
  2638.  
  2639. ┌────────────────────────────────────────────────────────────────────────────┐
  2640. │ VF_integralC             VD_integralC             VE_integralC             │
  2641. └────────────────────────────────────────────────────────────────────────────┘
  2642. Function        Integral of an array plotted over an equally-spaced abscissa.
  2643. Syntax          #include <VFstd.h>
  2644.                 float  VF_integralC( fVector X, ui size,
  2645.                                      float DeltaT );
  2646. Description     The vector X is assumed to be a function of a variable t; the
  2647.                 t values themselves are equally spaced, so that only the
  2648.                 spacing DeltaT is needed. The area under X, i.e. the integral
  2649.                 of X over t from t[0] to t[size-1] is calculated. If not only
  2650.                 the value of the integral is of interest, but a point-by-point
  2651.                 integration has to be performed, VF_runintegralC should be
  2652.                 used.
  2653. Error handling  none
  2654. Return value    The value of the integral is returned.
  2655. See also        VF_integralV,  VF_runintegralC,  VF_derivC
  2656.  
  2657.  
  2658. ┌────────────────────────────────────────────────────────────────────────────┐
  2659. │ VF_integralV             VD_integralV             VE_integralV             │
  2660. └────────────────────────────────────────────────────────────────────────────┘
  2661. Function        Integral
  2662. Syntax          #include <VFstd.h>
  2663.                 float  VF_integralV( fVector X, fVector Y, ui size );
  2664. Description     The vector Y is assumed to be a function of X; the integral of
  2665.                 Y over X is calculated. If the elements of X are regularly
  2666.                 spaced with a constant difference between them, the integral
  2667.                 is obtained more efficiently by VF_integralC. If not only the
  2668.                 value of the integral is of interest, but a point-by-point
  2669.                 integration has to be performed, VF_runintegralV may be used.
  2670. Error handling  none
  2671. Return value    The value of the integral is returned.
  2672. See also        VF_integralC,  VF_runintegralV,  VF_derivV
  2673.  
  2674.  
  2675. ┌────────────────────────────────────────────────────────────────────────────┐
  2676. │ VF_intfrac               VD_intfrac               VE_intfrac               │
  2677. └────────────────────────────────────────────────────────────────────────────┘
  2678. Function        Split up the elements of a vector into their integer and
  2679.                 fractional parts.
  2680. Syntax          #include <VFmath.h>
  2681.                 int  VF_intfrac( fVector IntPart, fVector FracPart,
  2682.                                  fVector X, ui size );
  2683. Description     The integer parts of the elements of X are stored in IntPart,
  2684.                 the fractional parts in FracPart. Notice that IntPart is a
  2685.                 floating-point vector, even though it contains integer numbers
  2686.                 (which might be larger than could be stored in the integer
  2687.                 data types).
  2688. Error handling  none
  2689. Return value    always 0
  2690. See also        modf,  VF_mantexp
  2691.  
  2692.  
  2693. ┌────────────────────────────────────────────────────────────────────────────┐
  2694. │ VF_inv                   VD_inv                   VE_inv                   │
  2695. │ VFx_inv                  VDx_inv                  VEx_inv                  │
  2696. │ VCF_inv                  VCD_inv                  VCE_inv                  │
  2697. │ VCFx_inv                 VCDx_inv                 VCEx_inv                 │
  2698. └────────────────────────────────────────────────────────────────────────────┘
  2699. Function        Inverse
  2700. Syntax          #include <VFmath.h>
  2701.                 int  VF_inv(  fVector Y,  fVector  X,  ui size );
  2702.                 int  VFx_inv( fVector Y,  fVector  X,  ui size,
  2703.                               float A,  float B );
  2704. Description     normal versions:   Yi = 1.0 / Xi
  2705.                 expanded versions: Yi = 1.0 / (A*Xi+B)
  2706. Error handling  Division by zero is treated as a SING error with the default
  2707.                 result set to HUGE_VAL. In the expanded versions, OVERFLOW
  2708.                 errors may also occur; the default result is set to ±HUGE_VAL.
  2709. Return value    0, if no error occurred;  otherwise non-zero.
  2710. See also        VF_divrC,  VF_divrV
  2711.  
  2712.  
  2713. ┌────────────────────────────────────────────────────────────────────────────┐
  2714. │ VF_ipow                  VD_ipow                  VE_ipow                  │
  2715. │ VCF_ipow                 VCD_ipow                 VCE_ipow                 │
  2716. │ VFx_ipow                 VDx_ipow                 VEx_ipow                 │
  2717. │ VCFx_ipow                VCDx_ipow                VCEx_ipow                │
  2718. └────────────────────────────────────────────────────────────────────────────┘
  2719. Function        Raise each element of a vector to a specified integer power.
  2720. Syntax          #include <VFmath.h>
  2721.                 int VF_ipow( fVector Y, fVector X, ui size, int Expo );
  2722.                 int VFx_ipow( fVector Y, fVector X, ui size, int Expo,
  2723.                               float A, float B, float C );
  2724. Description     normal versions:   Yi = Xi**Expo
  2725.                 expanded versions: Yi = C * (A*Xi+B)**Expo
  2726.                 If Expo is larger than a data-type dependent threshold (which
  2727.                 will be a very rare occasion), VF_ipow does not calculate the
  2728.                 result itself, but calls VF_pow,  which is safer and faster in
  2729.                 this case.
  2730. Error handling  SING errors occur, if zero is raised to a negative power; the
  2731.                 default result is ±HUGE_VAL, as in the case of OVERFLOW
  2732.                 errors.
  2733. Return value    0, if no error occurred, otherwise non-zero
  2734. See also        VF_pow,  VF_poly,  VF_pow2,  VF_exp,  pow
  2735.  
  2736.  
  2737. ┌────────────────────────────────────────────────────────────────────────────┐
  2738. │ VF_ipow10                VD_ipow10                VE_ipow10                │
  2739. └────────────────────────────────────────────────────────────────────────────┘
  2740. Function        Integer powers of 10
  2741. Syntax          #include <VFmath.h>
  2742.                 int  VF_ipow10(  fVector Y, iVector X, ui size );
  2743. Description     Yi  =  10**Xi
  2744.                 Notice: this function (and not VF_pow10 !) is the vectorized
  2745.                 form of the function pow10 defined in Borland C/C++.
  2746. Error handling  OVERFLOW errors lead to a default result of HUGE_VAL.
  2747. Return value    0, if no error occurred, otherwise non-zero
  2748. See also        VF_pow10,  VF_scale10,  VF_log10,  VF_ipow,  VF_exp,  pow
  2749.  
  2750.  
  2751. ┌────────────────────────────────────────────────────────────────────────────┐
  2752. │ VF_ipow2                 VD_ipow2                 VE_ipow2                 │
  2753. └────────────────────────────────────────────────────────────────────────────┘
  2754. Function        Integer powers of 2
  2755. Syntax          #include <VFmath.h>
  2756.                 int  VF_ipow2(  fVector Y,  iVector X, ui size );
  2757. Description     Yi  =  2**Xi
  2758. Error handling  OVERFLOW errors lead to a default result of HUGE_VAL.
  2759. Return value    0, if no error occurred, otherwise non-zero
  2760. See also        VF_pow2,  VF_scale2,  VF_log2,  VF_pow,  VF_exp,  pow
  2761.  
  2762.  
  2763. ┌────────────────────────────────────────────────────────────────────────────┐
  2764. │ VF_iselementC            VD_iselementC            VE_iselementC            │
  2765. │ VCF_iselementC           VCD_iselementC           VCE_iselementC           │
  2766. │ VI_iselementC       VSI_iselementC      VLI_iselementC      VQI_iselementC │
  2767. │ VU_iselementC       VUS_iselementC      VUL_iselementC      VUI_iselementC │
  2768. └────────────────────────────────────────────────────────────────────────────┘
  2769. Function        Test if one or more elements of a table are equal to C.
  2770. Syntax          #include <VFstd.h>
  2771.                 int  VF_iselementC( fVector Tab, ui size, float C );
  2772. Description     The vector Tab is searched for the value C. If one or more
  2773.                 elements are equal to C, TRUE (+1) is returned, otherwise
  2774.                 FALSE (0). No ordering of Tab is assumed and a linear search
  2775.                 performed. A related function that finds the table element
  2776.                 closest (but not necessarily equal) to C is VF_searchC.
  2777. Error handling  none
  2778. Return value    +1, if C  is an element of X, otherwise 0.
  2779. See also        VF_searchC, VF_iselementV, lfind, lsearch
  2780.  
  2781.  
  2782. ┌────────────────────────────────────────────────────────────────────────────┐
  2783. │ VF_iselementV            VD_iselementV            VE_iselementV            │
  2784. │ VCF_iselementV           VCD_iselementV           VCE_iselementV           │
  2785. │ VI_iselementV       VSI_iselementV      VLI_iselementV      VQI_iselementV │
  2786. │ VU_iselementV       VUS_iselementV      VUL_iselementV      VUI_iselementV │
  2787. └────────────────────────────────────────────────────────────────────────────┘
  2788. Function        Test for each element of a vector, if an identical element is
  2789.                 present in a table.
  2790. Syntax          #include <VFstd.h>
  2791.                 ui  VF_iselementV(  fVector Y,  fVector X,  ui sizex,
  2792.                                     fVector Tab, ui sizetab );
  2793. Description     The table Tab is searched for each of the elements of X. For
  2794.                 those elements of X which are found in Tab, the corresponding
  2795.                 element of Y is set to +1 (in the complex versions: {1, 0} ).
  2796.                 No ordering of X and Tab is assumed and a linear search for
  2797.                 each Xi performed. A related function that finds the table
  2798.                 element closest (but not necessarily equal) to each element of
  2799.                 X  is VF_searchV.
  2800. Error handling  none
  2801. Return value    The number of elements of X for which an element of Tab was
  2802.                 found is returned.
  2803. See also        VF_searchV, VF_iselementC
  2804.  
  2805.  
  2806. ┌────────────────────────────────────────────────────────────────────────────┐
  2807. │ VF_ismonoton             VD_ismonoton             VE_ismonoton             │
  2808. └────────────────────────────────────────────────────────────────────────────┘
  2809. Function        Test if the elements of a vector are monotonously increasing
  2810.                 or decreasing
  2811. Syntax          #include <VFstd.h>
  2812.                 int  VF_ismonoton( fVector X,  ui size );
  2813. Description     The vector X is analyzed. If the elements are in strict
  2814.                 descending order, -1 is returned; if they are either constant
  2815.                 or in strict ascending order, +1 is returned. Otherwise the
  2816.                 return value is 0. If X contains passages that are increasing
  2817.                 as well as passages that remain at a constant value, X is
  2818.                 regarded as monotonous only if the increasing passage follows
  2819.                 the constant passage, but not the other way round. Thus, the
  2820.                 series 0, 0, 0, 1, 2, 3 will be accepted as monotonous (return
  2821.                 value +1), whereas the series 1, 2, 3, 4, 4, 4 will not
  2822.                 (return value 0). Also the initially constant, then falling
  2823.                 series 0, 0, 0, -1, -2, -3 will not be regarded as monotonous.
  2824. Error handling  none
  2825. Return value    +1 in case of monotonous rise, or if all elements are
  2826.                 identical, -1 in case of monotonously falling values,  0 if
  2827.                 neither of these conditions is fulfilled.
  2828. See also        VF_sort
  2829.  
  2830.  
  2831. ┌────────────────────────────────────────────────────────────────────────────┐
  2832. │ V_ItoF                   V_ItoD                   V_ItoE                   │
  2833. │ V_SItoF                  V_SItoD                  V_SItoE                  │
  2834. │ V_LItoF                  V_LItoD                  V_LItoE                  │
  2835. │ V_QItoF                  V_QItoD                  V_QItoE                  │
  2836. │ V_UtoF                   V_UtoD                   V_UtoE                   │
  2837. │ V_UStoF                  V_UStoD                  V_UStoE                  │
  2838. │ V_ULtoF                  V_ULtoD                  V_ULtoE                  │
  2839. │ V_UItoF                  V_UItoD                  V_UItoE                  │
  2840. └────────────────────────────────────────────────────────────────────────────┘
  2841. Function        Convert integer numbers into floating-point data types.
  2842. Syntax          #include <VFstd.h>
  2843.                   (always the include-file belonging to the destination type!)
  2844.                 void V_ItoF( fVector Y, iVector X, ui size );
  2845.                     (all other functions of this family are similar)
  2846. Description     Each element of X is converted from the data type int, short
  2847.                 int, long int, quad, unsigned, unsigned short, unsigned long,
  2848.                 or ui, resp., into the data type float, double, or extended,
  2849.                 resp., and stored in Y. For the inverse procedure, i.e. the
  2850.                 conversion of floating-point numbers to integers, the
  2851.                 functions of the VF_roundtoI,  VF_floortoI,  VF_ceiltoI,  and
  2852.                 VF_choptoI families have to be used.
  2853. Error handling  none
  2854. Return value    none
  2855. See also        VF_roundtoI,  VF_floortoI,  VF_ceiltoI,  VF_choptoI,
  2856.                 VF_trunctoI,  V_ItoLI
  2857.  
  2858.  
  2859. ┌────────────────────────────────────────────────────────────────────────────┐
  2860. │ V_ItoSI                  V_ItoLI                  V_ItoQI                  │
  2861. │ V_SItoI                  V_SItoLI                 V_SItoQI                 │
  2862. │ V_LItoSI                 V_LItoI                  V_LItoQI                 │
  2863. │ V_QItoSI                 V_QItoI                  V_QItoLI                 │
  2864. │ V_UtoUS                  V_UtoUL                  V_UtoUI                  │
  2865. │ V_UStoU                  V_UStoUL                 V_UStoUI                 │
  2866. │ V_ULtoU                  V_ULtoUS                 V_ULtoUI                 │
  2867. │ V_UItoU                  V_UItoUS                 V_UItoUL                 │
  2868. │ V_ItoU                   V_SItoUS                 V_LItoUL                 │
  2869. │ V_UtoI                   V_UStoSI                 V_ULtoLI                 │
  2870. └────────────────────────────────────────────────────────────────────────────┘
  2871. Function        Interconversion of the integer data types
  2872. Syntax          #include <VLIstd.h>
  2873.                    (or <VIstd.h>,  <VUstd.h>,..., resp., depending on the
  2874.                     destination data type!)
  2875.                 void V_ItoLI( liVector Y,  iVector X, ui size );
  2876.                     (all other functions of this family are similar)
  2877. Description     Each element of the vector X is converted into the desired
  2878.                 data type and stored in Y.
  2879. Error handling  see chapter 5.2.
  2880. Return value    none
  2881. See also        V_ItoF
  2882.  
  2883.  
  2884. ┌────────────────────────────────────────────────────────────────────────────┐
  2885. │ VF_ldexp                 VD_ldexp                 VE_ldexp                 │
  2886. └────────────────────────────────────────────────────────────────────────────┘
  2887. Function        Scale by an integer power of 2.
  2888. Syntax          #include <VFmath.h>
  2889.                 int  VF_ldexp( fVector Y, fVector X, ui size, int expo );
  2890. Description     These functions are implemented as alias names for VF_scale2
  2891.                 etc., in order to maintain consistency with the ANSI C
  2892.                 function name ldexp. For details, see VF_scale2.
  2893.  
  2894.  
  2895. ┌────────────────────────────────────────────────────────────────────────────┐
  2896. │ VF_limit                 VD_limit                 VE_limit                 │
  2897. │ VCF_limit                VCD_limit                VCE_limit                │
  2898. └────────────────────────────────────────────────────────────────────────────┘
  2899. Function        Limit the values of the elements of a vector to a specified
  2900.                 range.
  2901. Syntax          #include <VFmath.h>
  2902.                 void  VF_limit( fVector Y,  fVector X,  ui size,
  2903.                                 float  Min,  float  Max );
  2904.                 void  VCF_limit( cfVector Y,  cfVector X,  ui size,
  2905.                                  fComplex  Min,  fComplex  Max );
  2906. Description     Real version:
  2907.                     Yi  =  Xi ,   if  Min <=  Xi  <=  Max
  2908.                     Yi  =  Max,   if  Xi  >   Max
  2909.                     Yi  =  Min,   if  Xi  <   Min
  2910.                     This function may be seen as a combination of VF_maxC
  2911.                     and VF_minC.
  2912.                 Complex version:
  2913.                     Similar to the real version, but the real and imaginary
  2914.                     parts are limited separately to the ranges specified in
  2915.                     the respective parts of Min and Max.
  2916. Error handling  none
  2917. Return value    none
  2918. See also        VF_maxC,   VF_minC,  VF_min,  VF_flush0
  2919.  
  2920.  
  2921. ┌────────────────────────────────────────────────────────────────────────────┐
  2922. │ VF_linregress            VD_linregress            VE_linregress            │
  2923. └────────────────────────────────────────────────────────────────────────────┘
  2924. Function        Linear regression
  2925. Syntax          #include <VFstd.h>
  2926.                 void  VF_linregress( fVector Param,  fVector X,
  2927.                                      fVector Y, ui size );
  2928. Description     The X-Y data are fitted to a straight line  y = ax + b;  the
  2929.                 parameters a and b are determined in such a way that the
  2930.                 quantity
  2931.                   h² = sum( (Yi - y(x=Xi) )² )
  2932.                 is minimized. Uncertainties da and db are also determined. On
  2933.                 output, Param is filled with the 5 elements {a, da, b, db, h²}
  2934.                 in the order indicated.
  2935. Error handling  none
  2936. Return value    none
  2937. See also        VF_linregresswW, VF_corrcoeff,  VF_chi2
  2938.  
  2939.  
  2940. ┌────────────────────────────────────────────────────────────────────────────┐
  2941. │ VF_lincomb               VD_lincomb               VE_lincomb               │
  2942. │ VCF_lincomb              VCD_lincomb              VCE_lincomb              │
  2943. └────────────────────────────────────────────────────────────────────────────┘
  2944. Function        linear combination of two vectors
  2945. Syntax          #include <VFstd.h>
  2946.                 void  VF_lincomb( fVector Z, fVector X, fVector Y, ui size,
  2947.                                   float  CX, float  CY );
  2948. Descirption     Zi = CX * Xi  +  CY * Yi
  2949. Error handling  none
  2950. Return value    none
  2951. See also        VFx_addV
  2952.  
  2953.  
  2954. ┌────────────────────────────────────────────────────────────────────────────┐
  2955. │ VF_linregresswW          VD_linregresswW          VE_linregresswW          │
  2956. └────────────────────────────────────────────────────────────────────────────┘
  2957. Function        Linear regression with weights
  2958. Syntax          #include <VFstd.h>
  2959.                 void  VF_linregresswW( fVector Param, fVector X,
  2960.                                        fVector Y, fVector InvVar, ui size );
  2961. Description     The X-Y data are weighted with the inverse of their variances
  2962.                 and fitted to a straight line  y = ax + b; the parameters a
  2963.                 and b are determined in such a way as to minimize the merit
  2964.                 function
  2965.                   chi²  =  sum(  (1 / Var[i]) * (Yi - y(x=Xi) )² )
  2966.                 (see also VF_chi2). The inverse of the variance of each data
  2967.                 point has to be passed to the function in the vector InvVar.
  2968.                 Uncertainties da and db are also  determined. On output,
  2969.                 Param is filled with the 5 elements {a, da, b, db, chi²} in
  2970.                 the order indicated.
  2971. Error handling  none
  2972. Return value    none
  2973. See also        VF_linregress, VF_corrcoeff,  VF_chi2
  2974.  
  2975.  
  2976. ┌────────────────────────────────────────────────────────────────────────────┐
  2977. │ V_LItoF                  V_LItoD                  V_LItoE                  │
  2978. └────────────────────────────────────────────────────────────────────────────┘
  2979. Function        Data type interconversions.  See V_ItoF!
  2980.  
  2981.  
  2982. ┌────────────────────────────────────────────────────────────────────────────┐
  2983. │ VF_ln                    VD_ln                    VE_ln                    │
  2984. │ VCF_ln                   VCD_ln                   VCE_ln                   │
  2985. │ VFx_ln                   VDx_ln                   VEx_ln                   │
  2986. │ VCFx_ln                  VCDx_ln                  VCEx_ln                  │
  2987. └────────────────────────────────────────────────────────────────────────────┘
  2988. Function        Natural logarithm
  2989. Syntax          #include <VFmath.h>
  2990.                 int  VF_ln(  fVector  Y,  fVector  X, ui size );
  2991.                 int  VFx_ln( fVector  Y,  fVector  X, ui size,
  2992.                              float A, float B, float C );
  2993. Description     These function names are synonyms for the functions of the
  2994.                 VF_log family. See VF_log for details.
  2995.  
  2996.  
  2997. ┌────────────────────────────────────────────────────────────────────────────┐
  2998. │ VF_localmaxima           VD_localmaxima           VE_localmaxima           │
  2999. └────────────────────────────────────────────────────────────────────────────┘
  3000. Function        Find the indices of local maxima
  3001. Syntax          #include <VFstd.h>
  3002.                 ui VF_localmaxima( uiVector Ind, fVector X,  ui size );
  3003. Description     The indices of local maxima in X are stored in Ind and the
  3004.                 number of local maxima is returned (this is the number of
  3005.                 elements of Ind). A local maximum is defined as one element
  3006.                 of X that is greater than both its neighbours to the right
  3007.                 and to the left. That means that the zeroth and the last
  3008.                 element of X (which have only one neighbour) cannot be local
  3009.                 maxima. Also, if two adjacent elements are equal, none of
  3010.                 them can be a local maximum.
  3011. Error handling  none
  3012. Return value    number of local maxima found
  3013. See also        VF_maxind, VF_max, VF_indpick, VF_localminima
  3014.  
  3015.  
  3016. ┌────────────────────────────────────────────────────────────────────────────┐
  3017. │ VF_localminima           VD_localminima           VE_localminima           │
  3018. └────────────────────────────────────────────────────────────────────────────┘
  3019. Function        Find the indices of local minima
  3020. Syntax          #include <VFstd.h>
  3021.                 ui VF_localminima( uiVector Ind, fVector X,  ui size );
  3022. Description     The indices of local minima in X are stored in Ind and the
  3023.                 number of local minima is returned (this is the number of
  3024.                 elements of Ind). A local minimum is defined as one element of
  3025.                 X that is smaller than both its neighbours to the right and to
  3026.                 the left. That means that the zeroth and the last element of X
  3027.                 (which have only one neighbour) cannot be local minima. Also,
  3028.                 if two adjacent elements are equal, none of them can be a
  3029.                 local minimum.
  3030. Error handling  none
  3031. Return value    number of local minima found
  3032. See also        VF_minind, VF_min, VF_indpick, VF_localmaxima
  3033.  
  3034.  
  3035. ┌────────────────────────────────────────────────────────────────────────────┐
  3036. │ VF_log                   VD_log                   VE_log                   │
  3037. │ VCF_log                  VCD_log                  VCE_log                  │
  3038. │ VFx_log                  VDx_log                  VEx_log                  │
  3039. │ VCFx_log                 VCDx_log                 VCEx_log                 │
  3040. └────────────────────────────────────────────────────────────────────────────┘
  3041. Function        Natural logarithm
  3042. Syntax          #include <VFmath.h>
  3043.                 int  VF_log(  fVector  Y,  fVector  X, ui size );
  3044.                 int  VFx_log( fVector  Y,  fVector  X, ui size,
  3045.                               float A, float B, float C );
  3046. Description     normal versions:    Yi = ln( Xi )
  3047.                 expanded versions:  Yi = C * ln( A*Xi+B )
  3048.                 The "logarithmus naturalis", i.e. the logarithm to the basis
  3049.                 of Euler's constant  e  is calculated.
  3050. Error handling  Real versions: DOMAIN errors occur in the case of negative Xi
  3051.                 (including -0.0), with NAN ("not-a-number") as the default
  3052.                 result. SING errors occur for Xi= +0.0 and yield a result of
  3053.                 -HUGE_VAL. In the complex version, numbers with an imaginary
  3054.                 part of zero are always treated as real numbers; therefore,
  3055.                 an argument {0, 0} is treated as a real 0, causing a SING
  3056.                 error with the default result {-HUGE_VAL,  0}.
  3057. Return value    0, if no error occurred, otherwise non-zero
  3058. See also        VF_exp,  VF_log2,  VF_log10, VF_pow,  log
  3059.  
  3060.  
  3061. ┌────────────────────────────────────────────────────────────────────────────┐
  3062. │ VF_log10                   VD_log10                   VE_log10             │
  3063. │ VCF_log10                  VCD_log10                  VCE_log10            │
  3064. │ VFx_log10                  VDx_log10                  VEx_log10            │
  3065. │ VCFx_log10                 VCDx_log10                 VCEx_log10           │
  3066. └────────────────────────────────────────────────────────────────────────────┘
  3067. Function        Decadic logarithm
  3068. Syntax          #include <VFmath.h>
  3069.                 int  VF_log10(  fVector  Y,  fVector  X, ui size );
  3070.                 int  VFx_log10( fVector  Y,  fVector  X, ui size,
  3071.                                 float A, float B, float C );
  3072. Description     normal versions:    Yi = lg( Xi )
  3073.                 expanded versions:  Yi = C * lg( A*Xi+B )
  3074.                 The decadic logarithm (to the basis of 10) is calculated.
  3075. Error handling  Real versions: DOMAIN errors occur in the case of negative Xi
  3076.                 (including -0.0), with NAN ("not-a-number") as the default
  3077.                 result. SING errors occur for Xi= +0.0 and yield a result of
  3078.                 -HUGE_VAL. In the complex version, numbers with an imaginary
  3079.                 part of zero are always treated as real numbers; therefore,
  3080.                 an argument {0, 0} is treated as a real 0, causing a SING
  3081.                 error with the default result {-HUGE_VAL,  0}.
  3082. Return value    0, if no error occurred, otherwise non-zero
  3083. See also        VF_pow10,  VF_log,  VF_log2,  VF_pow,  log10
  3084.  
  3085.  
  3086. ┌────────────────────────────────────────────────────────────────────────────┐
  3087. │ VF_log2                   VD_log2                   VE_log2                │
  3088. │ VCF_log2                  VCD_log2                  VCE_log2               │
  3089. │ VFx_log2                  VDx_log2                  VEx_log2               │
  3090. │ VCFx_log2                 VCDx_log2                 VCEx_log2              │
  3091. └────────────────────────────────────────────────────────────────────────────┘
  3092. Function        Binary logarithm
  3093. Syntax          #include <VFmath.h>
  3094.                 int  VF_log2(  fVector  Y,  fVector  X, ui size );
  3095.                 int  VFx_log2( fVector  Y,  fVector  X, ui size,
  3096.                                float A, float B, float C );
  3097. Description     normal versions:    Yi = lb( Xi )
  3098.                 expanded versions:  Yi = C * lb( A*Xi+B )
  3099.                 The binary logarithm (to the basis 2) is calculated.
  3100. Error handling  Real versions: DOMAIN errors occur in the case of negative Xi
  3101.                 (including -0.0), with NAN ("not-a-number") as the default
  3102.                 result. SING errors occur for Xi= +0.0 and yield a result of
  3103.                 -HUGE_VAL. In the complex version, numbers with an imaginary
  3104.                 part of zero are always treated as real numbers; therefore,
  3105.                 an argument {0, 0} is treated as a real 0, causing a SING
  3106.                 error with the default result {-HUGE_VAL,  0}.
  3107. Return value    0, if no error occurred, otherwise non-zero
  3108. See also        VF_pow2,  VF_log,  VF_log10,  VF_pow,  log2 (the latter
  3109.                 function is not defined in ANSI C, but an addition contained
  3110.                 in the VectorLib package, see chapter 9).
  3111.  
  3112.  
  3113. ┌────────────────────────────────────────────────────────────────────────────┐
  3114. │ VF_Lorentz               VD_Lorentz               VE_Lorentz               │
  3115. └────────────────────────────────────────────────────────────────────────────┘
  3116. Function        Lorentzian lineshape function
  3117. Syntax          #include <VFmath.h>
  3118.                 int  VF_Lorentz( fVector Y,  fVector X,  ui siz,
  3119.                                  float Wid,  float Cent,  float C );
  3120. Description    Yi   = C *  Wid² / ( (Xi - Cent)² + Wid² )
  3121.                 Wid  = width of the resonance line
  3122.                 Cent = centre of the line
  3123.                 C is a scaling factor; at the center of the line (Xi=Cent),
  3124.                 the amplitude Yi equals C. This is even true for a width of
  3125.                 zero.
  3126. Error handling  This function should be error-proof.
  3127. Return value    always 0
  3128. See also        VF_Gauss,  VF_sech2
  3129.  
  3130.  
  3131. ┌────────────────────────────────────────────────────────────────────────────┐
  3132. │ VF_mantexp               VD_mantexp               VE_mantexp               │
  3133. └────────────────────────────────────────────────────────────────────────────┘
  3134. Function        Split up the elements of a vector into their mantissa and
  3135.                 exponent parts
  3136. Syntax          #include <VFmath.h>
  3137.                 int  VF_mantexp( fVector MantPart,  iVector ExpPart,
  3138.                                  fVector  X,  ui size );
  3139. Description     The elements of X are split up into their mantissa, stored in
  3140.                 MantPart, and exponent, stored as ints in ExpPart.
  3141. Error handling  none
  3142. Return value    always 0
  3143. See also        VF_scale2,  VF_intfrac,  frexp,  ldexp
  3144.  
  3145.  
  3146. ┌────────────────────────────────────────────────────────────────────────────┐
  3147. │ VF_max                   VD_max                   VE_max                   │
  3148. │ VI_max              VSI_max             VLI_max             VQI_max        │
  3149. │ VU_max              VUS_max             VUL_max             VUI_max        │
  3150. └────────────────────────────────────────────────────────────────────────────┘
  3151. Function        Find the largest element of a vector.
  3152. Syntax          #include <VFstd.h>
  3153.                 float  VF_max( fVector X, ui size );
  3154. Description     The vector X is searched for its largest element, whose value
  3155.                 is returned.
  3156. Error handling  none
  3157. Return value    maximum value encountered.
  3158. See also        VF_min, VF_absmax, VF_runmax, VF_maxind
  3159.  
  3160.  
  3161. ┌────────────────────────────────────────────────────────────────────────────┐
  3162. │ VF_maxC                  VD_maxC                  VE_maxC                  │
  3163. │ VI_maxC            VSI_maxC             VLI_maxC            VQI_maxC       │
  3164. │ VU_maxC            VUS_maxC             VUL_maxC            VUI_maxC       │
  3165. └────────────────────────────────────────────────────────────────────────────┘
  3166. Function        Compare each element of a vector to a constant and take the
  3167.                 larger of the two.
  3168. Syntax          #include <VFmath.h>
  3169.                 void VF_maxC( fVector Y, fVector X, ui size, float C );
  3170. Description     Yi  =  Xi,      if  Xi  >   C
  3171.                 Yi  =  C,       if  Xi  <=  C
  3172. Error handling  none
  3173. Return value    none
  3174. See also        VF_maxV,  VF_minC,  VF_max,  VF_absmax,  VF_limit, VF_flush0
  3175.  
  3176.  
  3177. ┌────────────────────────────────────────────────────────────────────────────┐
  3178. │ VF_maxind                VD_maxind                VE_maxind                │
  3179. │ VI_maxind           VSI_maxind          VLI_maxind          VQI_maxind     │
  3180. │ VU_maxind           VUS_maxind          VUL_maxind          VUI_maxind     │
  3181. └────────────────────────────────────────────────────────────────────────────┘
  3182. Function        Find the largest element of a vector and its index.
  3183. Syntax          #include <VFstd.h>
  3184.                 float  VF_maxind( ui *Ind, fVector X, ui size );
  3185. Description     The vector X is searched for its largest element; its value is
  3186.                 returned. At the address passed as Ind, the index of this
  3187.                 element is stored.In the case of several maxima of equal
  3188.                 height, the first one is chosen (i.e., the smallest index
  3189.                 is stored in Ind).
  3190. Error handling  none
  3191. Return value    maximum value encountered.
  3192. See also        VF_max, VF_minind, VF_absmax, VF_runmax
  3193.  
  3194.  
  3195. ┌────────────────────────────────────────────────────────────────────────────┐
  3196. │ VCF_maxReIm              VCD_maxReIm              VCE_maxReIm              │
  3197. └────────────────────────────────────────────────────────────────────────────┘
  3198. Function        Find the largest real and imaginary parts occurring in a
  3199.                 vector.
  3200. Syntax          #include <VFmath.h>
  3201.                 fComplex   VCF_maxReIm( cfVector X, ui size );
  3202. Description     The vector X is separately searched for its largest real and
  3203.                 imaginary parts.
  3204. Error handling  none
  3205. Return value    struct of type fComplex (dComplex,  eComplex,  resp.), in
  3206.                 which the maxima of the real and imaginary parts of X are
  3207.                 packed together.
  3208. See also        VCF_minReIm,  VCF_absmaxReIm,  VCF_absmax,  VCF_absmaxind
  3209.  
  3210.  
  3211. ┌────────────────────────────────────────────────────────────────────────────┐
  3212. │ VF_maxV                  VD_maxV                  VE_maxV                  │
  3213. │ VI_maxV             VSI_maxV            VLI_maxV            VQI_maxV       │
  3214. │ VU_maxV             VUS_maxV            VUL_maxV            VUI_maxV       │
  3215. └────────────────────────────────────────────────────────────────────────────┘
  3216. Function        Compare each element of a vector to the corresponding element
  3217.                 of another vector and take the larger of the two.
  3218. Syntax          #include <VFmath.h>
  3219.                 void VF_maxV( fVector Z, fVector X, fVector Y, ui size );
  3220. Description     Zi  =  Xi,    if  Xi  >   Yi
  3221.                 Zi  =  Yi,    if  Xi  <=  Yi
  3222. Error handling  none
  3223. Return value    none
  3224. See also        VF_minV,   VF_maxC,  VF_max,   VF_absmax
  3225.  
  3226.  
  3227. ┌────────────────────────────────────────────────────────────────────────────┐
  3228. │ VF_mean                  VD_mean                  VE_mean                  │
  3229. │ VCF_mean                 VCD_mean                 VCE_mean                 │
  3230. │ VI_mean             VSI_mean            VLI_mean            VQI_mean       │
  3231. │ VU_mean             VUS_mean            VUL_mean            VUI_mean       │
  3232. └────────────────────────────────────────────────────────────────────────────┘
  3233. Function        Mean of a one-dimensional distribution
  3234. Syntax          #include <VFstd.h>
  3235.                 float    VF_mean(  fVector  X, ui size );
  3236.                      (similarly VD_, VE_, VCF_, VCD_, VCE_)
  3237.                 double   VI_mean( iVector X, ui size );
  3238.                      (similarly VSI_, VLI_, VU_, VUS_, VUL_, VUI_)
  3239.                 extended VQI_mean( qiVector X, ui size );
  3240. Description     mean  = (1 / size) * sum( Xi )
  3241.                 Integer versions: the mean of a distribution consisting of
  3242.                 whole numbers generally is a fractional, i.e. a floating-
  3243.                 point number. Therefore, the return value of the 16-bit
  3244.                 and 32-bit integer versions is a double. For the 64-bit
  3245.                 integer version VQI_mean, the return value is an extended.
  3246. Error handling  none
  3247. Return value    Mean of the vector elements
  3248. See also        VF_meanwW, VF_median, VF_meanvar, VF_varianceC, VF_linregress
  3249.  
  3250.  
  3251. ┌────────────────────────────────────────────────────────────────────────────┐
  3252. │ VF_meanabs               VD_meanabs               VE_meanabs               │
  3253. └────────────────────────────────────────────────────────────────────────────┘
  3254. Function        Mean of the absolute values of a one-dimensional distribution
  3255. Syntax          #include <VFstd.h>
  3256.                 float    VF_meanabs(  fVector  X, ui size );
  3257. Description     meanabs  = (1 / size) * sum(| Xi |)
  3258. Error handling  none
  3259. Return value    Mean of the absolute values of all vector elements
  3260. See also        VF_mean, VF_sumabs
  3261.  
  3262.  
  3263. ┌────────────────────────────────────────────────────────────────────────────┐
  3264. │ VF_meanvar               VD_meanvar               VE_meanvar               │
  3265. └────────────────────────────────────────────────────────────────────────────┘
  3266. Function        Mean and variance of a one-dimensional distribution
  3267. Syntax          #include <VFstd.h>
  3268.                 float  VF_meanvar( float *Var,  fVector X, ui size );
  3269. Description     mean = (1 / size)     * sum( Xi )
  3270.                 var  = (1 / (size-1)) * sum( (Xi - mean)² )
  3271.                 Note that the denominator in the definition of var is size-1,
  3272.                 whereas, in the routine VF_varianceC, it is simply size.The
  3273.                 reason for that difference is that here the mean is calculated
  3274.                 first and then the variance is determined using this value,
  3275.                 whereas in VF_varianceC, the parameter C is pre-set.
  3276.                 The mean is returned and the variance stored at the address
  3277.                 passed as Var.
  3278. Error handling  none
  3279. Return value    mean of the vector elements.
  3280. See also        VF_mean, VF_varianceC, VF_varianceV, VF_sum, VF_ssq,
  3281.                 VF_ssqdevC, VF_linregress
  3282.  
  3283.  
  3284. ┌────────────────────────────────────────────────────────────────────────────┐
  3285. │ VF_meanvarwW             VD_meanvarwW             VE_meanvarwW             │
  3286. └────────────────────────────────────────────────────────────────────────────┘
  3287. Function        Mean and variance with weights
  3288. Syntax          #include <VFmath.h>
  3289.                 float VF_meanvarwW( float *Var, fVector X, fVector Wt,
  3290.                                     ui size );
  3291. Description     mean =  (1 / sum( Wti )) * sum(  Xi * Wti )
  3292.                 var  =  (1 / sum( Wti )) * sum(  Wti * (Xi - mean)² )
  3293.                 The weighted mean is returned and the variance stored at the
  3294.                 address passed as Var.
  3295. Error handling  none
  3296. Return value    mean of the vector elements.
  3297. See also        VF_meanwW, VF_varianceCwW, VF_varianceVwW, VF_linregress
  3298.  
  3299.  
  3300. ┌────────────────────────────────────────────────────────────────────────────┐
  3301. │ VF_meanwW                VD_meanwW                VE_meanwW                │
  3302. │ VCF_meanwW               VCD_meanwW               VCE_meanwW               │
  3303. └────────────────────────────────────────────────────────────────────────────┘
  3304. Function        Mean with weights
  3305. Syntax          #include <VFstd.h>
  3306.                 float VF_meanwW( fVector X,  fVector Wt, ui size );
  3307.                     (similarly  VD_,  VE_)
  3308.                 fComplex VCF_meanwW( cfVector X, fVector Wt, ui size );
  3309.                     (similarly  VCD_,  VCE_)
  3310. Description     meanwW  =  (1 / sum( Wti )) *  sum( Xi * Wti )
  3311.                 Notice that, also in the complex version, the weights are
  3312.                 always real and not complex.
  3313. Error handling  none
  3314. Return value    weighted mean of the vector elements.
  3315. See also        VF_mean, VF_sum, VF_ssq, VF_ssqdevC, VF_median, VF_mean_varwW,
  3316.                 VF_linregresswW
  3317.  
  3318.  
  3319. ┌────────────────────────────────────────────────────────────────────────────┐
  3320. │ VF_median                VD_median                VE_median                │
  3321. └────────────────────────────────────────────────────────────────────────────┘
  3322. Function        Median of a one-dimensional distribution
  3323. Syntax          #include <VFmath.h>
  3324.                 float  VF_median( fVector X, ui size );
  3325. Description     The median of a distribution is defined as the value for which
  3326.                 values above and below are equally probable, i.e., for which
  3327.                 the number of elements greater and less than the median is
  3328.                 equal. If the table X is ordered, the median is simply the
  3329.                 element with the index (size+1)/2 (if size is odd) or the
  3330.                 mean of the two central elements (if size is even).
  3331.                 If a table is not ordered, VF_median finds its median by
  3332.                 repeatedly scanning through it without actually sorting it.
  3333. Error handling  none
  3334. Return value    The median is returned.
  3335. See also        VF_mean,VF_meanwW, VF_sum
  3336.  
  3337.  
  3338. ┌────────────────────────────────────────────────────────────────────────────┐
  3339. │ VF_min                   VD_min                   VE_min                   │
  3340. │ VI_min              VSI_min             VLI_min             VQI_min        │
  3341. │ VU_min              VUS_min             VUL_min             VUI_min        │
  3342. └────────────────────────────────────────────────────────────────────────────┘
  3343. Function        Finds the smallest (or the most negative) element of a vector.
  3344. Syntax          #include <VFstd.h>
  3345.                 float  VF_min( fVector X, ui size );
  3346. Description     The vector X is searched for its smallest (or most negative)
  3347.                 element.
  3348. Error handling  none
  3349. Return value    Minimum value encountered.
  3350. See also        VF_absmin,  VF_runmin,  VF_minind
  3351.  
  3352.  
  3353. ┌────────────────────────────────────────────────────────────────────────────┐
  3354. │ VF_minC                  VD_minC                  VE_minC                  │
  3355. │ VI_minC             VSI_minC            VLI_minC            VQI_minC       │
  3356. │ VU_minC             VUS_minC            VUL_minC            VUI_minC       │
  3357. └────────────────────────────────────────────────────────────────────────────┘
  3358. Function        Compare each element of a vector to a constant and take the
  3359.                 smaller of the two.
  3360. Syntax          #include <VFmath.h>
  3361.                 void VF_minC( fVector Y, fVector X, ui size, float C );
  3362. Description     Yi  =  Xi,    if  Xi  <=  C
  3363.                 Yi  =  C,     if  Xi  >   C
  3364. Error handling  none
  3365. Return value    none
  3366. See also        VF_minV,  VF_maxC, VF_min, VF_absmin, VF_limit, VF_flush0
  3367.  
  3368.  
  3369. ┌────────────────────────────────────────────────────────────────────────────┐
  3370. │ VF_minind                VD_minind                VE_minind                │
  3371. │ VI_minind           VSI_minind          VLI_minind          VQI_minind     │
  3372. │ VU_minind           VUS_minind          VUL_minind          VUI_minind     │
  3373. └────────────────────────────────────────────────────────────────────────────┘
  3374. Function        Find the smallest (or the most negative) element of a vector
  3375.                 and its index.
  3376. Syntax          #include <VFstd.h>
  3377.                 float  VF_minind( ui *Ind, fVector X, ui size );
  3378. Description     The vector X is searched for its smallest (or most negative)
  3379.                 element; its value is returned. At the address passed as Ind,
  3380.                 the index of this element is stored. In the case of several
  3381.                 mimima of equal depth, the first one is chosen (i.e., the
  3382.                 smallest of their indices is stored in Ind).
  3383. Error handling  none
  3384. Return value    minimum value encountered.
  3385. See also        VF_min, VF_minind, VF_absmin, VF_runmin
  3386.  
  3387.  
  3388. ┌────────────────────────────────────────────────────────────────────────────┐
  3389. │ VCF_minReIm              VCD_minReIm              VCE_minReIm              │
  3390. └────────────────────────────────────────────────────────────────────────────┘
  3391. Function        Find the smallest (or most negative) real and imaginary parts
  3392.                 occurring in a vector.
  3393. Syntax          #include <VCFstd.h>
  3394.                 fComplex  VCF_minReIm( cfVector X, ui size );
  3395. Description     The vector X is separately searched for its smallest real and
  3396.                 imaginary parts.
  3397. Error handling  none
  3398. Return value    struct of type fComplex (dComplex,  eComplex,  resp.), in
  3399.                 which the minima of the real and imaginary parts of X are
  3400.                 packed together.
  3401. See also        VCF_maxReIm,  VCF_absminReIm,  VCF_absmin,  VCF_absminind
  3402.  
  3403.  
  3404. ┌────────────────────────────────────────────────────────────────────────────┐
  3405. │ VF_minV                  VD_minV                  VE_minV                  │
  3406. │ VI_minV             VSI_minV            VLI_minV            VQI_minV       │
  3407. │ VU_minV             VUS_minV            VUL_minV            VUI_minV       │
  3408. └────────────────────────────────────────────────────────────────────────────┘
  3409. Function        Compare each element of a vector to the corresponding element
  3410.                 of another vector and take the smaller of the two.
  3411. Syntax          #include <VFmath.h>
  3412.                 void VF_minV( fVector Z, fVector X, fVector Y, ui size );
  3413. Description     Zi  =  Xi,    if  Xi  <=  Yi
  3414.                 Zi  =  Yi,    if  Xi  >   Yi
  3415. Error handling  none
  3416. Return value    none
  3417. See also        VF_maxV,   VF_minC,  VF_min,   VF_absmin
  3418.  
  3419.  
  3420. ┌────────────────────────────────────────────────────────────────────────────┐
  3421. │ VF_modC                  VD_modC                  VE_modC                  │
  3422. │ VI_modC             VSI_modC            VLI_modC            VQI_modC       │
  3423. │ VU_modC             VUS_modC            VUL_modC            VUI_modC       │
  3424. └────────────────────────────────────────────────────────────────────────────┘
  3425. Function        Modulus, i.e. the remainder of a division by a constant
  3426. Syntax          #include <VFmath.h>
  3427.                 void VF_modC( fVector Y, fVector X, ui size, float C );
  3428. Description     Yi  =  Xi  mod  C
  3429.                 Floating-point versions: a constant C = 0.0 leads to all Yi
  3430.                    being 0.0, independently of the Xi values (as in the
  3431.                    ANSI C math function fmod ).
  3432.                 Integer versions:  a constant C = 0 leads to a ZERODIVIDE
  3433.                    error (as in the intrinsic "%" operation of ANSI C).
  3434. Error handling  none
  3435. Return value    none  (also the floating-point versions are treated as basic
  3436.                 arithmetic rather than mathematical functions, despite their
  3437.                 relation to the math function fmod).
  3438. See also        VF_modV,   VF_addC,  VF_mulC,  VF_divC,  VF_visC,  VF_redC
  3439.  
  3440.  
  3441. ┌────────────────────────────────────────────────────────────────────────────┐
  3442. │ VF_modf                  VD_modf                  VE_modf                  │
  3443. └────────────────────────────────────────────────────────────────────────────┘
  3444. Function        Split up into integer and fractional parts.
  3445. Syntax          #include <VFmath.h>
  3446.                 int  VF_modf( fVector IntPart,  fVector FracPart,
  3447.                               fVector X, ui size );
  3448. Description     These functions are implemented as alias names for VF_intfrac
  3449.                 etc., in order to maintain consistency with the ANSI C
  3450.                 function name modf. For details, see VF_intfrac.
  3451.  
  3452.  
  3453. ┌────────────────────────────────────────────────────────────────────────────┐
  3454. │ VF_modV                  VD_modV                  VE_modV                  │
  3455. │ VFx_modV                 VDx_modV                 VEx_modV                 │
  3456. │ VI_modV             VSI_modV            VLI_modV            VQI_modV       │
  3457. │ VU_modV             VUS_modV            VUL_modV            VUI_modV       │
  3458. └────────────────────────────────────────────────────────────────────────────┘
  3459. Function        Modulus, i.e. the remainder of a division of corresponding
  3460.                 vector elements
  3461. Syntax          #include <VFmath.h>
  3462.                 void  VF_modV(  fVector Z, fVector X, fVector Y, ui size );
  3463.                 void  VFx_modV( fVector Z, fVector X, fVector Y,
  3464.                                 ui size, float A,  float  B );
  3465. Description     normal versions:    Zi  =  Xi  mod  Yi
  3466.                 expanded versions:  Zi  =  (A * Xi + B)  mod Yi
  3467.                 Floating-point versions: an argument Xi = 0.0 leads to Zi
  3468.                    being 0.0, independently of Yi (as in the ANSI C math
  3469.                    function fmod).
  3470.                 Integer versions:  an argument Xi = 0 leads to a ZERODIVIDE
  3471.                    error (as in the intrinsic "%" operation of ANSI C).
  3472. Error handling  none
  3473. Return value    none  (also the floating-point versions are treated as basic
  3474.                 arithmetic rather than mathematical functions, despite their
  3475.                 relation to the math function fmod).
  3476. See also        VF_modC,  VF_addV,  VF_mulV,  VF_divV,  VF_visV,  VF_redV
  3477.  
  3478.  
  3479. ┌────────────────────────────────────────────────────────────────────────────┐
  3480. │ VF_mulC                  VD_mulC                  VE_mulC                  │
  3481. │ VCF_mulC                 VCD_mulC                 VCE_mulC                 │
  3482. │ VCF_mulReC               VCD_mulReC               VCE_mulReC               │
  3483. │ VI_mulC             VSI_mulC            VLI_mulC            VQI_mulC       │
  3484. │ VU_mulC             VUS_mulC            VUL_mulC            VUI_mulC       │
  3485. └────────────────────────────────────────────────────────────────────────────┘
  3486. Function        Multiply all vector elements by a constant
  3487. Syntax          #include <VFmath.h>
  3488.                 void VF_mulC( fVector Y, fVector X, ui size, float C );
  3489.                     (similarly  VD_,  VE_, VI_,  etc.)
  3490.                 void VCF_mulC(  cfVector Y, cfVector X, ui size, fComplex C );
  3491.                 void VCF_mulReC( cfVector Y, cfVector X, ui size, float CRe );
  3492.                     (similarly  VCD_,  VCE_)
  3493. Description     Yi  =  C  *  Xi
  3494.                 The complex floating-point versions exist in two variants, one
  3495.                 for complex constants C, the other for real-valued constants
  3496.                 CRe by which the complex vector is multiplied.
  3497. Error handling  none
  3498. Return value    none
  3499. See also        VF_mulV,  VF_addC,   VF_divC,  VF_divrC,  VF_visC,  VF_redC
  3500.  
  3501.  
  3502. ┌────────────────────────────────────────────────────────────────────────────┐
  3503. │ VF_mulV                  VD_mulV                  VE_mulV                  │
  3504. │ VCF_mulV                 VCD_mulV                 VCE_mulV                 │
  3505. │ VCF_mulReV               VCD_mulReV               VCE_mulReV               │
  3506. │ VFs_mulV                 VDs_mulV                 VEs_mulV                 │
  3507. │ VFx_mulV                 VDx_mulV                 VEx_mulV                 │
  3508. │ VCFx_mulV                VCDx_mulV                VCEx_mulV                │
  3509. │ VCFx_mulReV              VCDx_mulReV              VCEx_mulReV              │
  3510. │ VI_mulV             VSI_mulV            VLI_mulV            VQI_mulV       │
  3511. │ VU_mulV             VUS_mulV            VUL_mulV            VUI_mulV       │
  3512. └────────────────────────────────────────────────────────────────────────────┘
  3513. Function        Multiply corresponding vector elements
  3514. Syntax          #include <VFmath.h>
  3515.                 void  VF_mulV(  fVector Z, fVector X, fVector Y, ui size );
  3516.                 void  VFs_mulV( fVector Z, fVector X, fVector Y, ui size,
  3517.                                 float C );
  3518.                 void  VFx_mulV( fVector Z, fVector X, fVector Y,
  3519.                                 ui size, float A,  float  B );
  3520.                 void  VCF_mulV( cfVector Z,  cfVector X,  cfVector Y,
  3521.                                 ui size );
  3522.                 void  VCF_mulReV( cfVector Z,  cfVector X, fVector Y,
  3523.                                   ui size );
  3524.                 void  VCFx_mulV(  cfVector Z, cfVector X, cfVector Y,
  3525.                                   ui size, fComplex A,  fComplex B );
  3526.                 void  VCFx_mulReV( cfVector Z, cfVector X, fVector Y,
  3527.                                    ui size, fComplex A, fComplex B );
  3528. Description     normal versions:    Zi  =  Xi  *  Yi
  3529.                 scaled versions:    Zi  =  C * (Xi * Yi)
  3530.                 expanded versions:  Zi  =  (A * Xi + B)  *  Yi
  3531.                 The complex floating-point versions exist in two variants: in
  3532.                 the first variant (e.g. VCF_mulV,  VCFx_mulV), X, Y, and Z are
  3533.                 all complex; in the second variant, Y is real-valued
  3534.                 (e.g. VCF_mulReV - "multiply by a real vector").
  3535. Error handling  none
  3536. Return value    none
  3537. See also        VF_mulC,  VF_addV,  VF_subV,  VF_divV,  VF_visV,  VF_redV
  3538.  
  3539.  
  3540. ┌────────────────────────────────────────────────────────────────────────────┐
  3541. │ VF_neg                   VD_neg                   VE_neg                   │
  3542. │ VCF_neg                  VCD_neg                  VCE_neg                  │
  3543. │ VI_neg              VSI_neg             VLI_neg             VQI_neg        │
  3544. └────────────────────────────────────────────────────────────────────────────┘
  3545. Function        Negation
  3546. Syntax          #include <VFmath.h>
  3547.                 int  VF_neg( fVector Y,  fVector X,  ui size );
  3548. Description     Yi  =  - (Xi)
  3549.                 VSI_,  VI_, and VLI_ versions only: the negation of the most
  3550.                 negative number possible (-32768 for short, -2147483648 for
  3551.                 long) is again the same - negative! - number. This is due to
  3552.                 the implicit modulo-2**n arithmetics, where the overflowing
  3553.                 short +32768 is stored as -32768, and the overflowing long
  3554.                 +2147483648 is stored as -2147483648.
  3555. Error handling  none
  3556. Return value    By analogy with VF_abs,  the floating-point versions are
  3557.                 treated as math functions. Therefore, they have a return
  3558.                 value which, since no errors can occur, is always 0. The
  3559.                 integer versions have no return value.
  3560. See also        VF_abs,  VCF_conj
  3561.  
  3562.  
  3563. ┌────────────────────────────────────────────────────────────────────────────┐
  3564. │ V_nfree                                                                    │
  3565. └────────────────────────────────────────────────────────────────────────────┘
  3566. Function        De-allocate memory occupied by one or more vectors.
  3567. Syntax          #include <VecLib.h>
  3568.                 void  V_nfree(  unsigned numfree, ... );
  3569. Description     The parameter numfree "tells" the function how many vectors it
  3570.                 has to free. These vectors follow in the parameter list after
  3571.                 numfree. De-allocation of vectors not allocated by one of the
  3572.                 functions of the VF_vector or VF_vector0 family is dis-
  3573.                 couraged, especially in Windows programs.
  3574.                 Note for Turbo Pascal users: since a variable number of
  3575.                 parameters is not supported in Turbo Pascal, this
  3576.                 function is missing in VectorLib for Turbo Pascal.
  3577. Example         V_nfree( 3, X, Y, Z );
  3578. Error handling  see V_free
  3579. Return value    none
  3580. See also        V_free,  VF_vector,  VF_vector0
  3581.  
  3582.  
  3583. ┌────────────────────────────────────────────────────────────────────────────┐
  3584. │ VF_noise                 VD_noise                 VE_noise                 │
  3585. └────────────────────────────────────────────────────────────────────────────┘
  3586. Function        Initialize a vector with "white" noise
  3587. Syntax          #include <VFstd.h>
  3588.                 long VF_noise( fVector X, ui size, long seed, float Amp );
  3589. Description     White noise is generated with the amplitude Amp, i.e., the
  3590.                 output values are between -Amp/2 and +Amp/2 (both extrema
  3591.                 included). seed may be chosen completely arbitrary; successive
  3592.                 calls with the same seed yield identical results, for
  3593.                 different values of seed, the obtained results are
  3594.                 uncorrelated.
  3595.  
  3596.                 Internally, these functions employ a 32-bit integer random
  3597.                 number generator by H.W.Lewis, with additional steps (so-
  3598.                 called "Bays-Durham shuffle") to break sequential correla-
  3599.                 tions. This ensures very good randomness, far superior
  3600.                 to simpler generators (like the rand function shipped with
  3601.                 Borland C++).
  3602.  
  3603.                 A long value is returned which may be used as new seed for
  3604.                 subsequent calls.
  3605. Error handling  none
  3606. Return value    last 32-bit random number internally generated; may be used as
  3607.                 new seed value for future calls.
  3608. See also        rand, random, VF_random
  3609.  
  3610.  
  3611. ┌────────────────────────────────────────────────────────────────────────────┐
  3612. │ VCF_norm                 VCD_norm                 VCE_norm                 │
  3613. └────────────────────────────────────────────────────────────────────────────┘
  3614. Function        Norm (square of the magnitude) of cartesian complex numbers.
  3615.                 Implemented as macros calling VF_CtoNorm, VD_CtoNorm,
  3616.                 and VE_CtoNorm, resp.  See these functions for details.
  3617.  
  3618.  
  3619. ┌────────────────────────────────────────────────────────────────────────────┐
  3620. │ VI_not              VSI_not             VLI_not             VQI_not        │
  3621. │ VU_not              VUS_not             VUL_not             VUI_not        │
  3622. └────────────────────────────────────────────────────────────────────────────┘
  3623. Function        Bit-wise complement
  3624. Syntax          #include <VImath.h>
  3625.                 void VI_not( iVector Y,  iVector X,  ui size );
  3626. Description     Yi  =  ~(Xi)
  3627.                 Each single bit of the element Xi is inverted (i.e., it is 0
  3628.                 in Yi, if it was 1 in Xi, and vice versa).
  3629. Error handling  none
  3630. Return value    none
  3631. See also        VI_and,  VI_or,  VI_neg
  3632.  
  3633.  
  3634. ┌────────────────────────────────────────────────────────────────────────────┐
  3635. │ V_noteError                                                                │
  3636. └────────────────────────────────────────────────────────────────────────────┘
  3637. Function        Construct and print an error message
  3638. Syntax          #include <VecLib.h>
  3639.                 void  V_noteError( char *fname, unsigned why );
  3640. Description     In case of an error, the math functions of VectorLib invoke
  3641.                 the following steps: First call _matherr (or _matherrl),
  3642.                 then inspect the return value of _matherr (or _matherrl) and
  3643.                 call V_noteError in case this return value was 0.
  3644.                 V_noteError then constructs the appropriate error message and
  3645.                 passes it to V_printErrorMsg, which is the function in charge
  3646.                 of actually printing the error message.
  3647.                 By default, the message is printed to the screen. The function
  3648.                 V_setErrorEventFile may be used to change this default action
  3649.                 and to redirect the output into an event file (exclusively or
  3650.                 in addition to the screen message).
  3651.                 fname is the name of the "complaining" function and  why
  3652.                 specifies the reason for the complaint (as defined in <math.h>
  3653.                 and described in connection with _matherr in the Borland C++
  3654.                 documentation). How to call V_noteError from a user-defined
  3655.                 _matherr function is described in chapter 5.3.  This function
  3656.                 will not be included in versions of VectorLib for compilers
  3657.                 that do already offer the possibility of printing error
  3658.                 messages simultaneously to the screen and to an event file.
  3659. Return value    none
  3660. See also        V_setErrorEventFile,  V_printErrorMsg, _matherr
  3661.  
  3662.  
  3663. ┌────────────────────────────────────────────────────────────────────────────┐
  3664. │ VF_nread                 VD_nread                 VE_nread                 │
  3665. │ VCF_nread                VCD_nread                VCE_nread                │
  3666. │ VI_nread            VSI_nread           VLI_nread           VQI_nread      │
  3667. │ VU_nread            VUS_nread           VUL_nread           VUI_nread      │
  3668. └────────────────────────────────────────────────────────────────────────────┘
  3669. Function        Read the columns of a table from a stream
  3670. Syntax          #include <VFstd.h>
  3671.                 VF_nread( unsigned n, ui size, FILE *stream, ... );
  3672. Description     n columns of a table are read into the vectors passed to
  3673.                 VF_nread. The number of lines is specified as the number
  3674.                 of elements of each vector, which is size.
  3675.  
  3676.                 The entries of each line should be separated by spaces
  3677.                 (' ') or tab characters ('\t').
  3678.  
  3679.                 Each line must be terminated by a line-feed character ('\n').
  3680.                 The length of the lines is limited according the following
  3681.                 rules:
  3682.                 - Either all lines have the same length. In this case, the
  3683.                   length is determined automatically and might in principle
  3684.                   be as large as 65535 characters.
  3685.                 - Or the maximum length is given by the number n of vectors
  3686.                   to be read and by the data type:
  3687.                     VF_    24*n        VSI_,  VUS_   21*n
  3688.                     VD_    32*n        VLI_,  VUL_   37*n
  3689.                     VE_    40*n        VQI_          32*n
  3690.                     VCF_   48*n        VI_,   VU_    as VSI_, VUS_  (in the
  3691.                     VCD_   64*n                      memory model FLAT as
  3692.                     VCE_   80*n                      VLI_, VUL_)
  3693.  
  3694.                 It is possible to read fewer vectors than there are columns
  3695.                 in a table. In this case, the trailing columns are neglected.
  3696.                 If, however, you try to read more vectors than there are
  3697.                 columns, the result is undefined and might lead to an error.
  3698.  
  3699.                 Complex versions:
  3700.                       Real und imaginary parts may (but need not) be enclosed
  3701.                       in braces { }. However, you must be consequent: Either
  3702.                       all or no element may be written with braces.
  3703.  
  3704.                 Whole-number versions except VQI_nread:
  3705.                        By default, the numbers to be read are interpreted
  3706.                        as decimal numbers. You may use V_setRadix to define
  3707.                        any radix between 2 and 36.
  3708. Example         VF_nread( 3, 100, DataFile, X, Y, Z );
  3709. Error handling  Real, complex and quad versions:
  3710.                       Overflowing numbers are silently truncated to
  3711.                       ±HUGE_VAL.
  3712.                  Whole-number versions except VQI_nread:
  3713.                       As long as the numbers can be represented as long or
  3714.                       unsigned long, overflowing bits are ignored in the
  3715.                       16-bit versions.
  3716.                       Numbers beyond the long range yield -1 (signed types)
  3717.                       or +HUGE_VAL (unsigned types).
  3718. Return value    none
  3719. See also        VF_nwrite, VF_read, VF_store, VF_recall, strtod, strtol
  3720.  
  3721.  
  3722. ┌────────────────────────────────────────────────────────────────────────────┐
  3723. │ VF_nwrite                VD_nwrite                VE_nwrite                │
  3724. │ VCF_nwrite               VCD_nwrite               VCE_nwrite               │
  3725. │ VI_nwrite           VSI_nwrite          VLI_nwrite          VQI_nwrite     │
  3726. │ VU_nwrite           VUS_nwrite          VUL_nwrite          VUI_nwrite     │
  3727. └────────────────────────────────────────────────────────────────────────────┘
  3728. Function        Write vectors as the columns of a table into a stream.
  3729. Syntax          #include <VFstd.h>
  3730.                 VF_nwrite( FILE *stream, unsigned n, ui size, ... );
  3731. Description     n vectors are written in ASCII format as the columns of a
  3732.                 table into stream. The number of lines is given by the
  3733.                 number of elements of each vector: size.
  3734.  
  3735.                 The default format and separation may be changed using
  3736.                 VF_setWriteFormat and VF_setNWriteSeparate, respectively.
  3737.  
  3738. Example         VF_nwrite( DataFile, 3, 100, X, Y, Z );
  3739.                      /* generates a table with 3 columns and 100 lines;
  3740.                         the columns are given by X, Y and Z.           */
  3741. Error handling  none
  3742. Return value    none
  3743. See also        VF_write, VF_nread, VF_store, VF_recall, fprintf
  3744.  
  3745.  
  3746. ┌────────────────────────────────────────────────────────────────────────────┐
  3747. │ VI_or               VSI_or              VLI_or              VQI_or         │
  3748. │ VU_or               VUS_or              VUL_or              VUI_or         │
  3749. └────────────────────────────────────────────────────────────────────────────┘
  3750. Function        Bit-wise "OR" operation
  3751. Syntax          #include <VImath.h>
  3752.                 void VI_or( iVector Y,  iVector X,  ui size,  int C);
  3753.                 void VUL_or( ulVector Y, ulVector X,  ui size,
  3754.                              unsigned long C );
  3755. Description     Yi  =  (Xi) │ C
  3756.                 The bit-wise "inclusive OR" operation is performed on each
  3757.                 element Xi with the bit-mask given by C. A bit is 1 in Yi, if
  3758.                 it was not simultaneously 0 in Xi and in C, i.e., if it was 1
  3759.                 at least in one of them.
  3760. Error handling  none
  3761. Return value    none
  3762. See also        VI_not,  VI_and,  VI_xor
  3763.  
  3764.  
  3765. ┌────────────────────────────────────────────────────────────────────────────┐
  3766. │ VF_Parzen                VD_Parzen                VE_Parzen                │
  3767. └────────────────────────────────────────────────────────────────────────────┘
  3768. Function        "Parzen" window for spectral analyses
  3769. Syntax          #include <VFmath.h>
  3770.                 void VF_Parzen( fVector X, ui size );
  3771. Description     Xi  = 1 - │(i - 0.5*(size - 1)) / 0.5*(size + 1)│
  3772. Error handling  none
  3773. Return value    none
  3774. See also        VF_Welch, VF_Hanning, VF_spectrum
  3775.  
  3776.  
  3777. ┌────────────────────────────────────────────────────────────────────────────┐
  3778. │ VCF_polar                VCD_polar                VCE_polar                │
  3779. └────────────────────────────────────────────────────────────────────────────┘
  3780. Function        Construct Cartesian complex numbers from polar coordinates
  3781.                 Implemented as a macro that calls VF_PolartoC, VD_PolartoC,
  3782.                 VE_PolartoC, resp.  See these functions for details.
  3783.  
  3784.  
  3785. ┌────────────────────────────────────────────────────────────────────────────┐
  3786. │ VF_PolartoC              VD_PolartoC              VE_PolartoC              │
  3787. └────────────────────────────────────────────────────────────────────────────┘
  3788. Function        Construct Cartesian complex numbers from polar coordinates
  3789. Syntax          #include <VFmath.h>
  3790.                 void VF_PolartoC( cfVector X,  fVector Mag,
  3791.                                   fVector Arg, ui size );
  3792. Description     The polar coordinates Mag (magnitude, absolute value) and
  3793.                 Arg (argument, angle) of each element are used to construct
  3794.                 the Cartesian complex vector X.
  3795. Error handling  The total loss of precision for very large values of Arg is
  3796.                 treated tacitly (without an error message); if it occurs,
  3797.                 the result is set to {Magi, 0}.
  3798. Return value    none
  3799. See also        VF_CtoPolar, VF_ReImtoC, VF_CtoAbs, VF_CtoArg, VF_CtoNorm
  3800.  
  3801.  
  3802. ┌────────────────────────────────────────────────────────────────────────────┐
  3803. │ VF_poly                  VD_poly                  VE_poly                  │
  3804. │ VFx_poly                 VDx_poly                 VEx_poly                 │
  3805. └────────────────────────────────────────────────────────────────────────────┘
  3806. Function        Polynomial
  3807. Syntax          #include <VFmath.h>
  3808.                 int  VF_poly( fVector  Y,  fVector  X, ui size,
  3809.                               fVector Coeff,  unsigned deg );
  3810.                 int  VFx_poly(  fVector  Y,  fVector  X, ui size,
  3811.                                 fVector Coeff,  unsigned deg,
  3812.                                 float A, float B );
  3813. Description     normal versions:
  3814.                        Yi  =  c0 + c1 * Xi + c2 * Xi² + ... + cn * Xi**n
  3815.                 expanded versions:
  3816.                        xi  =  (A*Xi + B),
  3817.                        Yi  =  c0 + c1 * xi + c2 * xi² + ... + cn * xi**n
  3818.                 A polynomial of degree deg is generated for every element of
  3819.                 X, using the coefficients contained in the vector Coeff.
  3820.                 The coefficients in Coeff have to be ordered in such a way
  3821.                 that the constant term is the zeroth element, the linear
  3822.                 coefficient the first element etc., up to the deg'th  element
  3823.                 which is the coefficient for the highest power used in the
  3824.                 polynomial. (Beware a frequent source of errors: for a
  3825.                 polynomial of deg = 4, there are 5 (!) coefficients; do not
  3826.                 forget the constant term).
  3827. Error handling  OVERFLOW errors lead to ±HUGE_VAL as the default result. In
  3828.                 contrast to the ANSI C function poly (where deg is declared
  3829.                 as int), the declaration of deg as unsigned precludes DOMAIN
  3830.                 errors (which would occur for negative deg).
  3831. Return value    0, if no error occurred, otherwise non-zero
  3832. See also        VF_ipow,  VF_pow,  poly
  3833.  
  3834.  
  3835. ┌────────────────────────────────────────────────────────────────────────────┐
  3836. │ VF_polyinterpol          VD_polyinterpol          VE_polyinterpol          │
  3837. └────────────────────────────────────────────────────────────────────────────┘
  3838. Function        Polynomial interpolation of X-Y-table values
  3839. Syntax          #include <VFstd.h>
  3840.                 void VF_polyinterpol(
  3841.                       fVector Y,    fVector X,    ui sizex,
  3842.                       fVector XTab, fVector YTab, ui sizetab,
  3843.                       unsigned deg );
  3844. Description     For each of the sizex elements of X, the corresponding element
  3845.                 of Y is interpolated from the XTab-YTab value pairs. XTab must
  3846.                 be ordered (either ascending or descending). All values of
  3847.                 XTab must be distinct; otherwise a division by zero may occur
  3848.                 and lead to a program abort. For each element of X, the
  3849.                 routine finds itself the appropriate place in the table. The
  3850.                 parameter deg denotes the number of points that will be taken
  3851.                 into account for the interpolation (this is not the degree of
  3852.                 the interpolating polynomial!). Any value between 0 and 2 will
  3853.                 be interpreted as meaning linear interpolation. A maximum of
  3854.                 10-point interpolation is possible.
  3855. Error handling  Trying to use too many elements for the interpolation
  3856.                 (deg > 10) leads to an error message "Not possible with more
  3857.                 than 10 elements" and to a program abort. If deg exceeds
  3858.                 sizetab, an error message "Invalid parameter(s)" is displayed
  3859.                 and the program aborted.
  3860.                 No other errors are detected (you have to take care yourself
  3861.                 that the XTab values are distinct and that the YTab values
  3862.                 are not near the limit of overflowing).
  3863. Return value    none
  3864. See also        VF_ratinterpol, VF_splineinterpol
  3865.  
  3866.  
  3867. ┌────────────────────────────────────────────────────────────────────────────┐
  3868. │ VF_pow                   VD_pow                   VE_pow                   │
  3869. │ VCF_pow                  VCD_pow                  VCE_pow                  │
  3870. │ VFx_pow                  VDx_pow                  VEx_pow                  │
  3871. │ VCFx_pow                 VCDx_pow                 VCEx_pow                 │
  3872. │ VCF_powReExpo            VCD_powReExpo            VCE_powReExpo            │
  3873. │ VCFx_powReExpo           VCDx_powReExpo           VCEx_powReExpo           │
  3874. └────────────────────────────────────────────────────────────────────────────┘
  3875. Function        Raise each element of a vector to a specified power
  3876. Syntax          #include <VFmath.h>
  3877.                 int  VF_pow( fVector Y, fVector X, ui size, float Expo );
  3878.                 int  VFx_pow(  fVector Y, fVector X, ui size, float Expo,
  3879.                                float A, float B, float C );
  3880.                 int  VCF_pow(  cfVector Y, cfVector X, ui size,
  3881.                                fComplex Expo );
  3882.                 int  VCFx_pow( cfVector Y,  cfVector X, ui size,
  3883.                                fComplex Expo,
  3884.                                fComplex A, fComplex B, fComplex C );
  3885.                 int  VCF_powReExpo(  cfVector Y, cfVector X, ui size,
  3886.                                float Expo );
  3887.                 int  VCFx_powReExpo( cfVector Y,  cfVector X, ui size,
  3888.                                float Expo,
  3889.                                fComplex A, fComplex B, fComplex C );
  3890. Description     normal versions:     Yi  =  Xi ** Expo
  3891.                 expanded versions:   Yi  =  C *  ((A*Xi+B) ** Expo)
  3892.                 If Expo is a moderately small integer number, the functions of
  3893.                 this family pass the job to the appropriate routine of the
  3894.                 VF_ipow family. More efficiently, the user could do just that
  3895.                 himself.
  3896.                 The complex version exists in two variants: one for complex
  3897.                 exponents, the other for complex numbers raised to a real
  3898.                 exponent.
  3899. Error handling  DOMAIN errors occur, if negative numbers are raised to
  3900.                 fractional powers; the default result is NAN ("not-a-number").
  3901.                 SING errors occur, if zero is raised to a negative power; the
  3902.                 default result is ±HUGE_VAL, which is true for OVERFLOW errors
  3903.                 as well.
  3904. Return value    0, if no error occurred, otherwise non-zero
  3905. See also        VF_ipow,  VF_poly,  VF_pow2,  VF_exp,  pow
  3906.  
  3907.  
  3908. ┌────────────────────────────────────────────────────────────────────────────┐
  3909. │ VF_pow10                 VD_pow10                 VE_pow10                 │
  3910. │ VFx_pow10                VDx_pow10                VEx_pow10                │
  3911. └────────────────────────────────────────────────────────────────────────────┘
  3912. Function        Real powers of 10
  3913. Syntax          #include <VFmath.h>
  3914.                 int  VF_pow10(  fVector Y, fVector  X, ui size );
  3915.                 int  VFx_pow10( fVector Y, fVector X, ui size,
  3916.                                 float A, float B, float C );
  3917. Description     normal versions:    Yi  =  10.0 ** Xi
  3918.                 expanded versions:  Yi  =  C * 10.0 ** (A*Xi+B)
  3919.                 This is an exponential function to the basis of 10.0.
  3920. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  3921. Return value    0, if no error occurred, otherwise non-zero
  3922. See also        VF_ipow10,  VF_scale10,  VF_log10,  VF_pow,  VF_exp,  pow
  3923.  
  3924.  
  3925. ┌────────────────────────────────────────────────────────────────────────────┐
  3926. │ VF_pow2                  VD_pow2                  VE_pow2                  │
  3927. │ VFx_pow2                 VDx_pow2                 VEx_pow2                 │
  3928. └────────────────────────────────────────────────────────────────────────────┘
  3929. Function        Real powers of 2
  3930. Syntax          #include <VFmath.h>
  3931.                 int  VF_pow2(  fVector Y, fVector X, ui size );
  3932.                 int  VFx_pow2( fVector Y, fVector X, ui size,
  3933.                                float A, float B, float C );
  3934. Description     normal versions:    Yi  =  2.0 ** Xi
  3935.                 expanded versions:  Yi  =  C * 2.0 ** (A*Xi+B)
  3936.                 This is an exponential function to the basis of 2.0.
  3937. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  3938. Return value    0, if no error occurred, otherwise non-zero
  3939. See also        VF_ipow2,  VF_scale2,  VF_log2,  VF_pow,  VF_exp,  pow
  3940.  
  3941.  
  3942. ┌────────────────────────────────────────────────────────────────────────────┐
  3943. │ VF_print                 VD_print                 VE_print                 │
  3944. │ VCF_print                VCD_print                VCE_print                │
  3945. │ VI_print            VSI_print           VLI_print           VQI_print      │
  3946. │ VU_print            VUS_print           VUL_print           VUI_print      │
  3947. └────────────────────────────────────────────────────────────────────────────┘
  3948. Function        Print a vector as ASCII numbers to stdout, assuming a
  3949.                 linewidth of 80 characters.
  3950. Syntax          #include <VFstd.h>
  3951.                 VF_print( fVector X, ui size,  unsigned nperline );
  3952. Description     size elements of X are printed to stdout,  nperline in each
  3953.                 line. The available linewidth is assumed to be 80 characters.
  3954.                 Each line begins with the index of the first element printed
  3955.                 into that line. The index is followed by a colon and by
  3956.                 the requested nperline elements.
  3957.                 Complex numbers are printed in braces, with the real and
  3958.                 imaginary parts separated by a komma:   {Re, Im}.
  3959.  
  3960.                 In contrast to VF_cprint, no paging is performed.
  3961.                 The number of digits per element is determined by the
  3962.                 available space, which depends in turn on nperline.
  3963.  
  3964.                 This family of functions is available under Windows only in
  3965.                 connection with EasyWin, and should not be used within
  3966.                 TurboVision programs.
  3967. Error handling  If nperline exceeds the maximum number of entries possible
  3968.                 within 80 characters, an error message "Cannot use requested
  3969.                 format (too many entries per line)" is generated; in this
  3970.                 case, the program chooses the maximum number nperline
  3971.                 possible.
  3972. Return value    none
  3973. See also        printf, VF_cprint, VF_fprint, VF_write, VF_store
  3974.  
  3975.  
  3976. ┌────────────────────────────────────────────────────────────────────────────┐
  3977. │ V_printErrorMsg                                                            │
  3978. └────────────────────────────────────────────────────────────────────────────┘
  3979. Function        Print an error message.
  3980. Syntax          #include <VecLib.h>
  3981.                 void  V_printErrorMsg( char *ErrMsg );
  3982. Description     As described in connection with V_noteError, this function is
  3983.                 in charge of printing error messages. By default, output is
  3984.                 directed to the screen. The function V_setErrorEventFile may
  3985.                 be used to redirect the output into an event file (exclusively
  3986.                 or in addition to the screen message). V_printErrorMsg may be
  3987.                 called from user-defined routines in which error conditions
  3988.                 are detected. If the message is longer than one line, carriage
  3989.                 returns ("\n" or "\r\n") have to be included at the desired
  3990.                 place. Note, however, that this function will not be included
  3991.                 in versions of VectorLib for compilers that do already offer
  3992.                 the possibility of printing error messages simultaneously to
  3993.                 the screen and to an event file.
  3994. Return value    none
  3995. See also        V_setErrorEventFile,  V_noteError, _matherr
  3996.  
  3997.  
  3998. ┌────────────────────────────────────────────────────────────────────────────┐
  3999. │ VF_prod                  VD_prod                  VE_prod                  │
  4000. │ VCF_prod                 VCD_prod                 VCE_prod                 │
  4001. └────────────────────────────────────────────────────────────────────────────┘
  4002. Function        Calculates the product of all the elements of a vector.
  4003. Syntax          #include <VFstd.h>
  4004.                 float   VF_prod( fVector X, ui size );
  4005. Description     The product of all elements of a vector is calculated.
  4006. Error handling  none (but be careful: this function may easily overflow!)
  4007. Return value    the product of the vector elements
  4008. See also        VF_runprod, VF_sum
  4009.  
  4010.  
  4011. ┌────────────────────────────────────────────────────────────────────────────┐
  4012. │ VF_quartic               VD_quartic               VE_quartic               │
  4013. │ VCF_quartic              VCD_quartic              VCE_quartic              │
  4014. │ VFx_quartic              VDx_quartic              VEx_quartic              │
  4015. │ VCFx_quartic             VCDx_quartic             VCEx_quartic             │
  4016. └────────────────────────────────────────────────────────────────────────────┘
  4017. Function        Fourth power
  4018. Syntax          #include <VFmath.h>
  4019.                 int  VF_quartic(  fVector  Y,  fVector  X, ui size );
  4020.                 int  VFx_quartic( fVector Y,  fVector  X, ui size,
  4021.                                   float A, float B );
  4022. Description     normal versions:    Yi  =  Xi ** 4
  4023.                 expanded versions:  Yi  =  (A*Xi+B) ** 4
  4024.                 The fourth power of the elements of X is stored in Y.
  4025. Error handling  OVERFLOW errors lead to a default result of HUGE_VAL.
  4026. Return value    0, if no error occurred, otherwise non-zero
  4027. See also        VF_square,  VF_cubic,  VF_sqrt,  VF_pow,  VF_ipow,  VF_poly
  4028.  
  4029.  
  4030. ┌────────────────────────────────────────────────────────────────────────────┐
  4031. │ VF_ramp                  VD_ramp                  VE_ramp                  │
  4032. │ VCF_ramp                 VCD_ramp                 VCE_ramp                 │
  4033. │ VI_ramp             VSI_ramp            VLI_ramp            VQI_ramp       │
  4034. │ VU_ramp             VUS_ramp            VUL_ramp            VUI_ramp       │
  4035. └────────────────────────────────────────────────────────────────────────────┘
  4036. Function        Initialize a vector with an ascending or descending "ramp".
  4037. Syntax          #include <VFstd.h>
  4038.                 void VF_ramp(   fVector X, ui size,
  4039.                                 float Start, float Rise );
  4040.                     (similarly  VD_,  VE_,  VCF_, VCD_, VCE_, VI_,  etc.)
  4041.                 void VU_ramp(   uVector  X, ui size,
  4042.                                 unsigned Start, int Rise );
  4043.                     (similarly  VUS_,  VUL_)
  4044. Description     Xi  =  Start + i * Rise
  4045.                 For the floating-point versions, remember the limited accuracy
  4046.                 of floating-point numbers. For example, after calling
  4047.                     VF_ramp( F1, 101, -1.0, 0.01 );
  4048.                 the element F1[100] will not be 0.0, as you might wish, but
  4049.                 rather something like 2.2E-8. Ths is due to the fact that
  4050.                 the number 0.01 (passed as a float to the function) is not
  4051.                 exactly representable in the data type float. If that is a
  4052.                 problem, consider building the ramp with moderately large
  4053.                 integers and dividing by a scaling factor afterwards:
  4054.                      VF_ramp( F1, 101, -100.0, 1.0 );
  4055.                      VF_divC( F1, F1, 101, 100.0 );
  4056.                 Note that Rise is defined as int instead of unsigned in the
  4057.                 VU_ version and as long instead of unsigned long in the VUL_
  4058.                 version; this exception from the general rules - that all
  4059.                 parameters in one function be of the same data type - allows
  4060.                 to create descending ramps of unsigned numbers, which
  4061.                 would not be possible otherwise.
  4062. Error handling  floating-point versions: none;
  4063.                 integer versions:  see chapter 5.2.
  4064. Return value    none
  4065. See also        VF_Parzen, VF_Welch, VF_equ1, VF_random
  4066.  
  4067.  
  4068. ┌────────────────────────────────────────────────────────────────────────────┐
  4069. │ VF_random                VD_random                VE_random                │
  4070. │ VI_random           VSI_random          VLI_random          VQI_random     │
  4071. │ VU_random           VUS_random          VUL_random          VUI_random     │
  4072. └────────────────────────────────────────────────────────────────────────────┘
  4073. Function        High-quality random numbers
  4074. Syntax          #include <VFstd.h>
  4075.                 long  VF_random( fVector X, ui siz, long seed,
  4076.                                  float MinVal, float MaxVal );
  4077. Description     The X vector is filled with a sequence of random numbers.
  4078.                 Within the ranges defined by MinVal and MaxVal, and within the
  4079.                 restrictions of floating-point representation, all numbers are
  4080.                 equally probable (including the extreme values themselves),
  4081.                 i.e., so-called "uniform deviates" are produced. The parameter
  4082.                 seed may be any number. Successive calls to one and the same
  4083.                 of these functions will yield identical sequences, if seed is
  4084.                 chosen equal; if seed is chosen differently for successive
  4085.                 calls, the results will be uncorrelated.
  4086.  
  4087.                 Internally, these functions employ a 32-bit integer random
  4088.                 number generator by H.W.Lewis, with additional steps (so-
  4089.                 called "Bays-Durham shuffle") to break sequential
  4090.                 correlations. This ensures very good randomness, far superior
  4091.                 to simpler generators (like the rand function shipped with
  4092.                 Borland C++).
  4093.  
  4094.                 A long value is returned which may be used as new seed for
  4095.                 subsequent calls.
  4096. Error handling  none
  4097. Return value    last 32-bit random number generated; this may be used as a new
  4098.                 seed value for future calls.
  4099. See also        rand, srand, random, VF_noise
  4100.  
  4101.  
  4102. ┌────────────────────────────────────────────────────────────────────────────┐
  4103. │ VF_ratinterpol           VD_ratinterpol           VE_ratinterpol           │
  4104. └────────────────────────────────────────────────────────────────────────────┘
  4105. Function        Diagonal-rational interpolation
  4106. Syntax          #include <VFmath.h>
  4107.                 void  VF_ratinterpol(
  4108.                                 fVector Y, fVector X, ui sizex,
  4109.                                 fVector XTab, fVector YTab, ui sizetab,
  4110.                                 unsigned deg );
  4111. Description     For each of the sizex elements of X, the corresponding element
  4112.                 of Y is interpolated from the XTab-YTab value pairs. XTab must
  4113.                 be ordered (either ascending or descending). All values of
  4114.                 XTab must be distinct; otherwise a division by zero may occur
  4115.                 and lead to a program abort. The parameter deg denotes the
  4116.                 number of points that will be taken into account for the
  4117.                 interpolation; the diagonal rational interpolation scheme by
  4118.                 Stoer and Bulirsch is used. The interpolating function is
  4119.                 formed by the quotient of two polynomials, the polynomial in
  4120.                 the denominator being of the same order (for even deg) or of
  4121.                 an order higher by one (for odd deg) than the polynomial of
  4122.                 the numerator.
  4123.                 Diagonal rational interpolation is superior to polynomial
  4124.                 interpolation, especially in the presence of poles. It is,
  4125.                 however, much slower.
  4126.                 deg must be between 3 and 20.
  4127. Error handling  A pole (infinity) in the interpolated function is recognized
  4128.                 and leads to a SING error with the proposed result being
  4129.                 ±HUGE_VAL. (Note: the x-value passed to _matherr is the first
  4130.                 element of XTab). Trying to use too many elements for the
  4131.                 interpolation (deg > 20) leads to an error message "Not
  4132.                 possible with more than 20 elements" and to a program abort.
  4133.                 If deg is not between 3 and 20, or exceeds sizetab, an error
  4134.                 message "Invalid parameter(s)" is displayed and the program
  4135.                 aborted.
  4136. Return value    none
  4137. See also        VF_polyinterpol, VF_splineinterpol
  4138.  
  4139.  
  4140. ┌────────────────────────────────────────────────────────────────────────────┐
  4141. │ VF_read                  VD_read                  VE_read                  │
  4142. │ VCF_read                 VCD_read                 VCE_read                 │
  4143. │ VI_read             VSI_read            VLI_read            VQI_read       │
  4144. │ VU_read             VUS_read            VUL_read            VUI_read       │
  4145. └────────────────────────────────────────────────────────────────────────────┘
  4146. Function        reads a vector in ASCII format from a stream
  4147. Syntax          #include <VFstd.h>
  4148.                 VF_read( fVector X, ui size, FILE *stream );
  4149. Description     size elements are read in ASCII format (up to 80 characters)
  4150.                 from stream and stored in X. Normally, this function will be
  4151.                 used to import vectors from a program which cannot store
  4152.                 numbers in machine format. It can also be used to retrieve
  4153.                 vectors previously stored by VF_write. For storing and
  4154.                 retrieving intermediate results, however, the function pair
  4155.                 VF_store / VF_recall  is to be preferred over  VF_write /
  4156.                 VF_read  (see VF_write).
  4157.  
  4158.                 The entries to be read must be separated by whitespace
  4159.                 (' ', '\n', or '\t'). Additionally, one (!) "non-whitespace"
  4160.                 character is tolerated after each entry, if it follows
  4161.                 directly after the last digit. After it, there must be one
  4162.                 or more whitespace characters.
  4163.  
  4164.                 Complex versions:
  4165.                       Real und imaginary parts may (but need not) be enclosed
  4166.                       in braces { }. However, you must be consequent: Either
  4167.                       all or no element may be written with braces.
  4168.  
  4169.                 Whole-number versions except VQI_nread:
  4170.                        By default, the numbers to be read are interpreted
  4171.                        as decimal numbers. You may use V_setRadix to define
  4172.                        any radix between 2 and 36.
  4173. Error handling  Real, complex and quad versions:
  4174.                       Overflowing numbers are silently truncated to
  4175.                       ±HUGE_VAL.
  4176.                  Whole-number versions except VQI_read:
  4177.                       As long as the numbers can be represented as long or
  4178.                       unsigned long, overflowing bits are ignored in the
  4179.                       16-bit versions.
  4180.                       Numbers beyond the long range yield -1 (signed types)
  4181.                       or +HUGE_VAL (unsigned types).
  4182. Return value    none
  4183. See also        VF_nread, VF_write, VF_store, VF_recall, strtod, strtol
  4184.  
  4185.  
  4186. ┌────────────────────────────────────────────────────────────────────────────┐
  4187. │ VCF_real                 VCD_real                 VCE_real                 │
  4188. └────────────────────────────────────────────────────────────────────────────┘
  4189. Function        Extracts the real part from a complex vector. Implemented as
  4190.                 macros calling VF_CtoRe, VD_CtoRe, or VE_CtoRe, resp.
  4191.                 See these functions for details.
  4192.  
  4193.  
  4194. ┌────────────────────────────────────────────────────────────────────────────┐
  4195. │ VF_recall                VD_recall                VE_recall                │
  4196. │ VCF_recall               VCD_recall               VCE_recall               │
  4197. │ VI_recall           VSI_recall          VLI_recall          VQI_recall     │
  4198. │ VU_recall           VUS_recall          VUL_recall          VUI_recall     │
  4199. └────────────────────────────────────────────────────────────────────────────┘
  4200. Function        Read a vector in binary format from a stream
  4201. Syntax          #include <VFstd.h>
  4202.                 VF_recall( fVector X, ui size, FILE *stream );
  4203. Description     size elements of X are read from stream in binary format.
  4204.                 Normally, these functions are used to retrieve data stored by
  4205.                 the respective function of the VF_store family.
  4206. Error handling  none
  4207. Return value    none
  4208. See also        fwrite,  fread,  VF_store, VF_write, VF_print
  4209.  
  4210.  
  4211. ┌────────────────────────────────────────────────────────────────────────────┐
  4212. │ VF_redC                  VD_redC                  VE_redC                  │
  4213. └────────────────────────────────────────────────────────────────────────────┘
  4214. Function        "Reduce"  by a constant
  4215. Syntax          #include <VFmath.h>
  4216.                 void VF_redC( fVector Y, fVector X, ui size, float C );
  4217. Description     Yi  =   red( Xi, C )  =  Xi * C / (Xi + C)
  4218.                 Expressions of this type are frequently used in physics; for
  4219.                 example, the "reduced mass" of a two-body system is the
  4220.                 product of both masses divided by their sum.
  4221. Error handling  none
  4222. Return value    none
  4223. See also        VF_redV,  VF_addC,  VF_subC,  VF_divC,  VF_visC
  4224.  
  4225.  
  4226. ┌────────────────────────────────────────────────────────────────────────────┐
  4227. │ VF_redV                  VD_redV                  VE_redV                  │
  4228. │ VFx_redV                 VDx_redV                 VEx_redV                 │
  4229. └────────────────────────────────────────────────────────────────────────────┘
  4230. Function        "Reduce" by corresponding vector elements
  4231. Syntax          #include <VFmath.h>
  4232.                 void  VF_redV(  fVector  Z,  fVector  X,  fVector  Y,
  4233.                                 ui size );
  4234.                 void  VFx_redV( fVector  Z,  fVector  X,  fVector  Y,
  4235.                                 ui size, float  A,  float  B );
  4236. Description     normal versions:      Zi =  red( Xi, Yi )
  4237.                                          =  Xi * Yi / (Xi + Yi)
  4238.                 expanded versions:    xi =  (A * Xi + B),
  4239.                                       Zi =  red( xi, Yi )
  4240. Error handling  none
  4241. Return value    none
  4242. See also        VF_redC,  VF_addV,  VF_subV,  VF_divV,  VF_visV
  4243.  
  4244.  
  4245. ┌────────────────────────────────────────────────────────────────────────────┐
  4246. │ VF_reflect               VD_reflect               VE_reflect               │
  4247. │ VCF_reflect              VCD_reflect              VCE_reflect              │
  4248. └────────────────────────────────────────────────────────────────────────────┘
  4249. Function        Derive the second half of a vector from the first half by
  4250.                 reflection at the midpoint.
  4251. Syntax          #include <VFstd.h>
  4252.                 void  VF_reflect( fVector X, ui size );
  4253. Description     X[size-i-1] =  X[i],   i=0,...,(size-1)/2
  4254.                 The elements of the lower half of a vector are copied in
  4255.                 reverse order into the upper half, i.e., the zeroth element is
  4256.                 copied to the last, the element number 1 to the second last,
  4257.                 and so on. The elements of the first half are not affected by
  4258.                 this operation. This function will be used, e.g., to construct
  4259.                 a response function for convolutions (see VF_convolve). In
  4260.                 this case, note that the zeroth element is to appear only once
  4261.                 in the response function and must not be included in the
  4262.                 reflection by VF_reflect. Therefore, you have to calculate
  4263.                 the response function for size/2+1 elements and to apply
  4264.                 reflection from element 1 on. For an example, see VF_convolve.
  4265. Error handling  none
  4266. Return value    none
  4267. See also        VF_rotate, VF_rev, VF_convolve, VF_deconvolve, VF_filter
  4268.  
  4269.  
  4270. ┌────────────────────────────────────────────────────────────────────────────┐
  4271. │ VF_ReImtoC               VD_ReImtoC               VE_ReImtoC               │
  4272. └────────────────────────────────────────────────────────────────────────────┘
  4273. Function        Construct a complex vector from real and imaginary parts
  4274. Syntax          #include <VCFstd.h>
  4275.                 void VF_ReImtoC( cfVector Y, fVector Re, fVector Im,
  4276.                                  ui size );
  4277. Description     The complex vector Y is constructed from two real vectors that
  4278.                 become the real and imaginary parts of Y.
  4279. Error handling  none
  4280. Return value    none
  4281. See also        VF_CtoReIm, VF_RetoC, VF_PolartoC
  4282.  
  4283.  
  4284. ┌────────────────────────────────────────────────────────────────────────────┐
  4285. │ VF_RetoC                 VD_RetoC                 VE_RetoC                 │
  4286. └────────────────────────────────────────────────────────────────────────────┘
  4287. Function        Overwrite the real part of a complex vector with a real vector
  4288. Syntax          #include <VCFstd.h>
  4289.                 void VF_RetoC( cfVector Y, fVector Re, ui size );
  4290. Description     The real part of the complex vector Y is overwritten with the
  4291.                 elements of the real-valued vector Re. The imaginary part of Y
  4292.                 is not affected.
  4293. Error handling  none
  4294. Return value    none
  4295. See also        VF_CtoReIm, VF_ReImtoC,  VF_ImtoC, VF_PolartoC
  4296.  
  4297.  
  4298. ┌────────────────────────────────────────────────────────────────────────────┐
  4299. │ VF_rev                   VD_rev                   VE_rev                   │
  4300. │ VCF_rev                  VCD_rev                  VCE_rev                  │
  4301. │ VI_rev              VSI_rev             VLI_rev             VQI_rev        │
  4302. │ VU_rev              VUS_rev             VUL_rev             VUI_rev        │
  4303. └────────────────────────────────────────────────────────────────────────────┘
  4304. Function        Reverse the ordering of the elements of a vector
  4305. Syntax          #include <VFstd.h>
  4306.                 void  VF_rev( fVector Y, fVector X, ui size );
  4307. Description     Y[i] = X[size-i-1]
  4308. Error handling  none
  4309. Return value    none
  4310. See also        VF_reflect, VF_rotate
  4311.  
  4312.  
  4313. ┌────────────────────────────────────────────────────────────────────────────┐
  4314. │ VF_rms                   VD_rms                   VE_rms                   │
  4315. └────────────────────────────────────────────────────────────────────────────┘
  4316. Function        Root of the mean square
  4317. Syntax          #include <VFstd.h>
  4318.                 float VF_rms( fVector X, ui size );
  4319. Description     rms = sqrt( (1/size) * sum( Xi² ) )
  4320. Error handling  none
  4321. Return value    rms
  4322. See also        VF_ssq, VF_Euclid, VF_mean
  4323.  
  4324.  
  4325. ┌────────────────────────────────────────────────────────────────────────────┐
  4326. │ VF_rotate                VD_rotate                VE_rotate                │
  4327. │ VCF_rotate               VCD_rotate               VCE_rotate               │
  4328. │ VI_rotate           VSI_rotate          VLI_rotate          VQI_rotate     │
  4329. │ VU_rotate           VUS_rotate          VUL_rotate          VUI_rotate     │
  4330. └────────────────────────────────────────────────────────────────────────────┘
  4331. Function        Rotate the ordering of the elements of a vector
  4332. Syntax          #include <VFstd.h>
  4333.                 void  VF_rotate(  fVector Y, fVector X, ui size,  int  pos );
  4334. Description     Y[i]  = X[size-pos+i],   i=0,..,pos-1
  4335.                 Y[i]  = X[i-pos],        i=pos,..,size-1
  4336.                 The output vector equals the rotated input vector. Clockwise
  4337.                 rotation is achieved by a positive number pos.
  4338. Error handling  none
  4339. Return value    none
  4340. See also        VF_reflect, VF_rev
  4341.  
  4342.  
  4343. ┌────────────────────────────────────────────────────────────────────────────┐
  4344. │ VF_round                 VD_round                 VE_round                 │
  4345. │ VF_roundtoI              VD_roundtoI              VE_roundtoI              │
  4346. │ VF_roundtoSI             VD_roundtoSI             VE_roundtoSI             │
  4347. │ VF_roundtoLI             VD_roundtoLI             VE_roundtoLI             │
  4348. │ VF_roundtoQI             VD_roundtoQI             VE_roundtoQI             │
  4349. │ VF_roundtoU              VD_roundtoU              VE_roundtoU              │
  4350. │ VF_roundtoUS             VD_roundtoUS             VE_roundtoUS             │
  4351. │ VF_roundtoUL             VD_roundtoUL             VE_roundtoUL             │
  4352. │ VF_roundtoUI             VD_roundtoUI             VE_roundtoUI             │
  4353. └────────────────────────────────────────────────────────────────────────────┘
  4354. Function        Rounding to the nearest whole number.
  4355. Syntax          #include <VFmath.h>
  4356.                 int VF_round(     fVector Y,  fVector X,  ui size );
  4357.                 int VF_roundtoI(  iVector Y,  fVector X,  ui size );
  4358.                 int VF_roundtoLI( liVector Y, fVector X, ui size );
  4359.                    (similarly  all other functions of this family)
  4360. Description     Each element of X is rounded to the nearest integer value. In
  4361.                 case of a fractional part of exactly 0.5, the nearest even
  4362.                 integer value is chosen and stored in Y. For example, 2.5 is
  4363.                 rounded to 2, and 3.5 is rounded to 4.
  4364.                 The functions VF_roundtoI, VF_roundtoLI, VF_roundtoU, etc.
  4365.                 convert the result into the various integer data types.
  4366. Error handling  OVERFLOW errors are handled by setting the result to the
  4367.                 extreme value possible. Negative numbers in the versions
  4368.                 VF_roundtoU, VF_roundtoUS, VF_roundtoUL, and VF_roundtoUI
  4369.                 lead to DOMAIN errors; they are handled by setting the result
  4370.                 to 0.
  4371. Return value    Returns 0, if no error occurred, otherwise non-zero.
  4372. See also        round,  floor, VF_round,  VF_floor, VF_chop, VF_trunc
  4373.  
  4374.  
  4375. ┌────────────────────────────────────────────────────────────────────────────┐
  4376. │ VF_runintegralC          VD_runintegralC          VE_runintegralC          │
  4377. └────────────────────────────────────────────────────────────────────────────┘
  4378. Function        "running integral" of an array sampled at equally-spaced
  4379.                 abscissa points.
  4380. Syntax          #include <VFstd.h>
  4381.                 void  VF_runintegralC(  fVector  Y,  fVector  X,
  4382.                                         ui size,  float DeltaT );
  4383. Description     The vector X is assumed to be a function of a variable t; the
  4384.                 t values themselves are equally spaced. Therefore, only their
  4385.                 spacing, DeltaT, must be known to the function. Each element
  4386.                 of Y is the integral of all elements of X up to and including
  4387.                 the one with the same index. Thus, the last element of Y
  4388.                 contains the value of the integral over the whole of X (the
  4389.                 area under X). If only this value is of interest, VF_integralC
  4390.                 should be used.
  4391. Error handling  none
  4392. Return value    none
  4393. See also        VF_runintegralV,  VF_integralC,  VF_derivC,  VF_runsum
  4394.  
  4395.  
  4396. ┌────────────────────────────────────────────────────────────────────────────┐
  4397. │ VF_runintegralV          VD_runintegralV          VE_runintegralV          │
  4398. └────────────────────────────────────────────────────────────────────────────┘
  4399. Function        "running integral"
  4400. Syntax          #include <VFmath.h>
  4401.                 void  VF_runintegralV(  fVector Z,  fVector  X,
  4402.                                         fVector  Y,  ui size );
  4403. Description     Y is a function of the variable x which is represented by X.
  4404.                 Each element of Z is the integral over all elements of Y up to
  4405.                 and including the one with the same index. The first element
  4406.                 of Z is always 0.0.  The last element of Z is equal to the
  4407.                 value of the integral, i.e. to the area under Y. If only this
  4408.                 value of the integral is of interest, VF_integralV should be
  4409.                 used.
  4410. Error handling  none
  4411. Return value    none
  4412. See also        VF_runintegralC,  VF_integralV,  VF_derivV
  4413.  
  4414.  
  4415. ┌────────────────────────────────────────────────────────────────────────────┐
  4416. │ VF_runmax                VD_runmax                VE_runmax                │
  4417. │ VI_runmax           VSI_runmax          VLI_runmax          VQI_runmax     │
  4418. │ VU_runmax           VUS_runmax          VUL_runmax          VUI_runmax     │
  4419. └────────────────────────────────────────────────────────────────────────────┘
  4420. Function        "running" maximum.
  4421. Syntax          #include <VFstd.h>
  4422.                 void  VF_runmax( fVector Y, fVector X, ui size );
  4423. Description     Each element of Y is the maximum of the corresponding and all
  4424.                 preceding elements of X.
  4425. Error handling  none
  4426. Return value    none
  4427. See also        VF_max, VF_runmin, VF_runsum
  4428.  
  4429.  
  4430. ┌────────────────────────────────────────────────────────────────────────────┐
  4431. │ VF_runmin                VD_runmin                VE_runmin                │
  4432. │ VI_runmin           VSI_runmin          VLI_runmin          VQI_runmin     │
  4433. │ VU_runmin           VUS_runmin          VUL_runmin          VUI_runmin     │
  4434. └────────────────────────────────────────────────────────────────────────────┘
  4435. Function        "running" minimum
  4436. Syntax          #include <VFstd.h>
  4437.                 void  VF_runmin( fVector Y, fVector X, ui size );
  4438. Description     Each element of Y is the minimum of the corresponding and all
  4439.                 preceding elements of X.
  4440. Error handling  none
  4441. Return value    none
  4442. See also        VF_min, VF_runmax, VF_runsum
  4443.  
  4444.  
  4445. ┌────────────────────────────────────────────────────────────────────────────┐
  4446. │ VF_runprod               VD_runprod               VE_runprod               │
  4447. │ VCF_runprod              VCD_runprod              VCE_runprod              │
  4448. └────────────────────────────────────────────────────────────────────────────┘
  4449. Function        "running" product
  4450. Syntax          #include <VFstd.h>
  4451.                 void  VF_runprod( fVector Y, fVector X, ui size );
  4452. Description     Each element of Y is the product of the corresponding and all
  4453.                 preceding elements of X. This function should be used with
  4454.                 care: overflow is easily reached, and underflow may lead to
  4455.                 all elements from a certain position on being zero.
  4456. Error handling  none
  4457. Return value    none
  4458. See also        VF_prod, VF_runsum
  4459.  
  4460.  
  4461. ┌────────────────────────────────────────────────────────────────────────────┐
  4462. │ VF_runsum                VD_runsum                VE_runsum                │
  4463. │ VCF_runsum               VCD_runsum               VCE_runsum               │
  4464. │ VI_runsum           VSI_runsum          VLI_runsum          VQI_runsum     │
  4465. │ VU_runsum           VUS_runsum          VUL_runsum          VUI_runsum     │
  4466. └────────────────────────────────────────────────────────────────────────────┘
  4467. Function        "running" sum
  4468. Syntax          #include <VFstd.h>
  4469.                 void  VF_runsum( fVector Y, fVector X, ui size );
  4470. Description     Each element of Y is the sum of the corresponding and all
  4471.                 preceding elements of X.
  4472. Error handling  none (but be careful: this function may easily overflow!)
  4473. Return value    none
  4474. See also        VF_sum, VF_runprod
  4475.  
  4476.  
  4477. ┌────────────────────────────────────────────────────────────────────────────┐
  4478. │ VF_scale10               VD_scale10               VE_scale10               │
  4479. └────────────────────────────────────────────────────────────────────────────┘
  4480. Function        Scaling by an integer power of 10.
  4481. Syntax          #include <VFmath.h>
  4482.                 int  VF_scale10( fVector Y,  fVector X,  ui size, int expo );
  4483. Description     Yi  =  Xi * (10 ** expo)
  4484.                 Notice that higher powers of ten are not representable as
  4485.                 exact numbers, which may lead to the introduction of round-off
  4486.                 error by the scaling. If this is a problem, VF_scale2  should
  4487.                 be used instead.
  4488. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  4489. Return value    0, if no error occurred, otherwise non-zero
  4490. See also        VF_scale2,  VF_mantexp,  ldexp
  4491.  
  4492.  
  4493. ┌────────────────────────────────────────────────────────────────────────────┐
  4494. │ VF_scale2                VD_scale2                VE_scale2                │
  4495. └────────────────────────────────────────────────────────────────────────────┘
  4496. Function        Scaling by an integer power of  2.
  4497. Syntax          #include <VFmath.h>
  4498.                 int VF_scale2( fVector Y, fVector X, ui size, int expo );
  4499. Description     Yi  =  Xi  *  (2 ** expo)
  4500. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  4501. Return value    0, if no error occurred, otherwise non-zero
  4502. See also        VF_scale10,  VF_mantexp,  ldexp
  4503.  
  4504.  
  4505. ┌────────────────────────────────────────────────────────────────────────────┐
  4506. │ VF_scalprod              VD_scalprod              VE_scalprod              │
  4507. └────────────────────────────────────────────────────────────────────────────┘
  4508. Function        Scalar product of two vectors
  4509. Syntax          #include <VFstd.h>
  4510.                 float VF_scalprod( fVector X, fVector Y, ui size );
  4511. Description     scalprod  =  sum( Xi * Yi )
  4512.                 The scalar (or dot) product of two vectors is defined as the
  4513.                 sum of the products of the corresponding elements. The scalar
  4514.                 product of a vector with itself is the square of its magnitude
  4515.                 and may be calculated using the function VF_ssq.
  4516. Error handling  none
  4517. Return value    scalar product
  4518. See also        VF_prod,  VF_xprod, VF_sum, VF_ssq
  4519.  
  4520.  
  4521. ┌────────────────────────────────────────────────────────────────────────────┐
  4522. │ VF_searchC               VD_searchC               VE_searchC               │
  4523. └────────────────────────────────────────────────────────────────────────────┘
  4524. Function        Binary searches of an ordered table for the entry coming
  4525.                 closest to a specified value
  4526. Syntax          #include <VFstd.h>
  4527.                 ui VF_searchC( fVector X, ui size, float C, int mode );
  4528. Description     In a binary search, the element of X is located that is
  4529.                 closest to the value specified as C. X has to be an ordered
  4530.                 table (either ascending or descending); if this condition is
  4531.                 not fulfilled, the result will be wrong. If C is outside the
  4532.                 range covered by X, the first or the last element of X is
  4533.                 chosen, whichever is closer to C. If C is within the range of
  4534.                 the table, three modes of the search are available:
  4535.                 mode =  +1:  find the next element greater than or equal to C
  4536.                 mode =   0:  find the element closest to C; if two elements
  4537.                              are within equal distance, choose the lower index
  4538.                 mode =  -1:  find the next element less than or equal to C
  4539. Error handling  none
  4540. Return value    index of the element found.
  4541. See also        VF_searchV,  VF_sort, VF_polyinterpol
  4542.  
  4543.  
  4544. ┌────────────────────────────────────────────────────────────────────────────┐
  4545. │ VF_searchV               VD_searchV               VE_searchV               │
  4546. └────────────────────────────────────────────────────────────────────────────┘
  4547. Function        Binary search of an ordered table for the entries coming
  4548.                 closest to the values specified as the elements of a vector
  4549. Syntax          #include <VFstd.h>
  4550.                 void VF_searchV( uiVector Ind, fVector X, ui sizex,
  4551.                                  fVector Tab, ui sizetab, int mode );
  4552. Description     For each element of X, the element of the ordered table Tab is
  4553.                 located that is closest to it. If Xi is outside the range of
  4554.                 the table, the first or the last element of the table is
  4555.                 chosen, whichever is appropriate. Otherwise, three modes of
  4556.                 the search are available:
  4557.                 mode =  +1:  find the next element greater than or equal to Xi
  4558.                 mode =   0:  find the element closest to Xi; if two elements
  4559.                              are within equal distance, choose the lower index
  4560.                 mode =  -1:  find the next element less than or equal to Xi
  4561.  
  4562.                 sizex is the number of elements of X and of Ind, whereas
  4563.                 sizetab denotes the number of elements of the table Tab.
  4564. Error handling  none
  4565. Return value    none
  4566. See also        VF_searchC, VF_indpick, VF_sortind, VF_polyinterpol
  4567.  
  4568.  
  4569. ┌────────────────────────────────────────────────────────────────────────────┐
  4570. │ VF_sec                   VD_sec                   VE_sec                   │
  4571. │ VFx_sec                  VDx_sec                  VEx_sec                  │
  4572. └────────────────────────────────────────────────────────────────────────────┘
  4573. Function        Secant function
  4574. Syntax          #include <VFmath.h>
  4575.                 int  VF_sec(  fVector  Y,  fVector  X, ui size );
  4576.                 int  VFx_sec( fVector  Y,  fVector  X, ui size,
  4577.                               float A,  float B,  float C );
  4578. Description     normal versions:    Yi  =  sec( Xi )
  4579.                                         =  1 / cos( Xi )
  4580.                 expanded versions:  Yi  =  C * sec( A*Xi+B )
  4581.                 The secant is defined as the inverse of the cosine (not to be
  4582.                 mistaken for the arcus function arccos). For large values of
  4583.                 Xi, round-off error becomes appreciable; if the Xi values are
  4584.                 representable as rational multiples of Pi, it is better to use
  4585.                 VF_secrpi  than VF_sec.
  4586. Error handling  SING or OVERFLOW errors lead to the default result ±HUGE_VAL.
  4587.                 TLOSS precision errors lead to a result of 1.0 (as if the
  4588.                 input were 0.0).
  4589. Return value    0, if no error occurred, otherwise non-zero.
  4590. See also        VF_sec2,  VF_secrpi,  VF_cos,  VF_sech,  cos
  4591.  
  4592.  
  4593. ┌────────────────────────────────────────────────────────────────────────────┐
  4594. │ VF_sec2                  VD_sec2                  VE_sec2                  │
  4595. │ VFx_sec2                 VDx_sec2                 VEx_sec2                 │
  4596. └────────────────────────────────────────────────────────────────────────────┘
  4597. Function        Square of the secant function
  4598. Syntax          #include <VFmath.h>
  4599.                 int  VF_sec2(   fVector  Y,  fVector  X, ui size );
  4600.                 int  VFx_sec2(  fVector  Y,  fVector  X, ui size,
  4601.                                 float A,  float B,  float C );
  4602. Description     normal versions:     Yi = sec²( Xi )
  4603.                 expanded versions:   Yi = C * sec²( A*Xi+B )
  4604.                 Calculating the squared trigonometric functions directly is
  4605.                 faster and sometimes more accurate than first calculating the
  4606.                 trigonometric function itself and squaring it afterwards.
  4607. Error handling  For SING and OVERFLOW errors, the default result is HUGE_VAL
  4608.                 (multiplied by the sign of C in the expanded versions);
  4609.                 TLOSS errors lead to a default result of 1.0 or C, resp. (as
  4610.                 if the input were 0.0).
  4611. Return value    0, if no error occurred, otherwise non-zero.
  4612. See also        VF_sec,   VF_secrpi,   sin
  4613.  
  4614.  
  4615. ┌────────────────────────────────────────────────────────────────────────────┐
  4616. │ VF_sech                  VD_sech                  VE_sech                  │
  4617. │ VFx_sech                 VDx_sech                 VEx_sech                 │
  4618. └────────────────────────────────────────────────────────────────────────────┘
  4619. Function        Hyperbolic secant function
  4620. Syntax          #include <VFmath.h>
  4621.                 int  VF_sech(   fVector  Y,  fVector  X, ui size );
  4622.                 int  VFx_sech(  fVector  Y,  fVector  X, ui size,
  4623.                                 float A, float B, float C );
  4624. Description     normal versions:     Yi  =  sech( Xi )
  4625.                                          =  2 / (exp( Xi ) + exp( -Xi ))
  4626.                 expanded versions:   Yi  =  C * sech( A*Xi+B )
  4627. Error handling  These functions should be error-proof.
  4628. Return value    always 0
  4629. See also        VF_sinh,  VF_sech2, VF_exp,   sinh
  4630.  
  4631.  
  4632. ┌────────────────────────────────────────────────────────────────────────────┐
  4633. │ VF_sech2                 VD_sech2                 VE_sech2                 │
  4634. │ VFx_sech2                VDx_sech2                VEx_sech2                │
  4635. └────────────────────────────────────────────────────────────────────────────┘
  4636. Function        Square of the hyperbolic secant function
  4637. Syntax          #include <VFmath.h>
  4638.                 int  VF_sech2(   fVector  Y,  fVector  X, ui size );
  4639.                 int  VFx_sech2(  fVector  Y,  fVector  X, ui size,
  4640.                                  float A, float B, float C );
  4641. Description     normal versions:      Yi =  sech²( Xi )
  4642.                 expanded versions:    Yi =  C * sech²( A*Xi+B )
  4643.                 The sech² function is used in physics, e.g., to describe the
  4644.                 shape of ultrashort light pulses. Compared to a Gaussian or
  4645.                 Lorentzian pulse shape of the same autocorrelation width (see
  4646.                 VF_autocorr), the sech² function has the smallest FWHM (full
  4647.                 width to half maximum).
  4648. Error handling  These functions should be error-proof.
  4649. Return value    always 0
  4650. See also        VF_sech,  VF_sinh, VF_exp,   VF_Gauss,  VF_Lorentz
  4651.  
  4652.  
  4653. ┌────────────────────────────────────────────────────────────────────────────┐
  4654. │ VF_secrpi                VD_secrpi                VE_secrpi                │
  4655. │ VF_secrpi2               VD_secrpi2               VE_secrpi2               │
  4656. │ VF_secrpi3               VD_secrpi3               VE_secrpi3               │
  4657. └────────────────────────────────────────────────────────────────────────────┘
  4658. Function        Secant function of fractional multiples of Pi
  4659. Syntax          #include <VFmath.h>
  4660.                 int  VF_secrpi(  fVector Y, iVector P, ui size, int q );
  4661.                 int  VF_secrpi2( fVector Y, iVector P, ui size, int q );
  4662.                 int  VF_secrpi3( fVector Y, iVector P, ui size, int q );
  4663. Description     Yi  =  sec( (P[i] / q) * Pi )
  4664.                 The secant of fractional multiples of Pi is calculated. There
  4665.                 are three versions: VF_secrpi is for general use with any
  4666.                 arbitrary denominator q. If q is a power of 2,  VF_secrpi2
  4667.                 should be used which is a highly optimized version utilizing a
  4668.                 look-up table. If q is a multiple of 3,  VF_secrpi3 should be
  4669.                 used. VF_secrpi2 and VF_secrpi3 work also with q values they
  4670.                 are not optimized for; in this case, however, memory space is
  4671.                 wasted for the tables.
  4672. Error handling  SING errors occur if P[i] / q  is an odd multiple of ½; the
  4673.                 default result is 0.0 (which is the mean of +HUGE_VAL and
  4674.                 -HUGE_VAL; similarly to VF_cosecrpi2, 0.0 is chosen irrespec-
  4675.                 tive to the fact that it is not a valid result of the secant
  4676.                 function!);
  4677.                 q must be non-zero; this is, however, not tested for.
  4678. Return value    0, if no error occurred, otherwise non-zero.
  4679. See also        VF_sec,   cos
  4680.  
  4681.  
  4682. ┌────────────────────────────────────────────────────────────────────────────┐
  4683. │ VF_selected_mean         VD_selected_mean         VE_selected_mean         │
  4684. └────────────────────────────────────────────────────────────────────────────┘
  4685. Function        Mean of the elements of a one-dimensional distribution,
  4686.                 falling into a specified interval
  4687. Syntax          #include <VFstd.h>
  4688.                 float  VF_selected_mean( ui *nsel, fVector  X, ui size
  4689.                                          float XMin, float XMax );
  4690. Description     Those elements of X are selected, which fall into the interval
  4691.                       XMin <= Xi <= XMax.
  4692.                 Their mean is calculated, and the number of selected elements
  4693.                 is stored at the address nsel. If this number is not needed,
  4694.                 nsel may be passed to the function as NULL.
  4695. Error handling  none
  4696. Return value    Mean of the selected vector elements
  4697. See also        VF_mean
  4698.  
  4699.  
  4700. ┌────────────────────────────────────────────────────────────────────────────┐
  4701. │ V_setCoordSystem                                                           │
  4702. └────────────────────────────────────────────────────────────────────────────┘
  4703. Function        Restore the scalings and position of a coordinate
  4704.                 system previously saved by V_getCoordSystem
  4705. Syntax          #include <Vgraph.h>
  4706.                 void V_setCoordSystem( VCOORDSYSTEM *csys );
  4707. Description     If one wants to "hop" between several coordinate systems,
  4708.                 displayed in one and the same window, one has to store the
  4709.                 specifications (position and scalings) of each coordinate
  4710.                 system separately, using V_getCoordSystem, and to retrieve
  4711.                 them as needed, using this function.
  4712.                 The address of a struct VCOORDSYSTEM is passed as the
  4713.                 argument. VCOORDSYSTEM is defined in <Vgraph.h>.
  4714.                 For an example, see V_getCoordSystem.
  4715. Error handling  none
  4716. Return value    none
  4717. See also        V_getCoordSystem, V_setPlotRegion, V_continuePlot
  4718.  
  4719.  
  4720. ┌────────────────────────────────────────────────────────────────────────────┐
  4721. │ V_setErrorEventFile                                                        │
  4722. └────────────────────────────────────────────────────────────────────────────┘
  4723. Function        Prepare a file for printing error messages into it
  4724. Syntax          #include <VecLib.h>
  4725.                 void  V_setErrorEventFile(
  4726.                                 char *filename,
  4727.                                 unsigned ScreenAndFile );
  4728. Description     This function determines where to print messages notifying
  4729.                 math errors that occur within VectorLib routines. filename is
  4730.                 the desired name of the event file (often called "log-file").
  4731.                 ScreenAndFile decides if you wish to have error messages
  4732.                 printed simultaneously into the file and onto the screen
  4733.                 (ScreenAndFile > 0)  or exclusively into the file
  4734.                 (ScreenAndFile = 0).
  4735.                 If a user-defined _matherr function calls V_noteError,
  4736.                 also errors occurring outside VectorLib routines will lead to
  4737.                 a message printed into the event file (see Chapter 5.5). This
  4738.                 function will not be included in versions of VectorLib for
  4739.                 compilers which offer the possibility of printing error
  4740.                 messages simultaneously to the screen and into an event file.
  4741.  
  4742.                 The default, i.e., printing error messages to the screen, is
  4743.                 restored by V_closeErrorEventFile.
  4744. Error handling  If the desired event file cannot be opened or created, the
  4745.                 program is aborted with a message "Cannot open error event
  4746.                 file".
  4747. Return value    none
  4748. See also        V_noteError,  V_closeErrorEventFile,  _matherr
  4749.  
  4750.  
  4751. ┌────────────────────────────────────────────────────────────────────────────┐
  4752. │ V_setLineThickness                                                         │
  4753. └────────────────────────────────────────────────────────────────────────────┘
  4754. Function        Modify the line thickness used in plotting functions
  4755. Syntax          #include <Vgraph.h>
  4756.                 void V_setLineThickness( unsigned linethickness );
  4757. Description     The line thickness used in the plotting functions
  4758.                 VF_xyAutoPlot, VCF_autoPlot, etc., is set to linethickness.
  4759.                 To reset the default value, call V_setLineThickness with
  4760.                 linethickness = 1.
  4761.                 DOS:
  4762.                    There are only two possible values for linethickness:
  4763.                    NORM_WIDTH=1 and THICK_WIDTH=3. Any value of linethickness
  4764.                    below 3 is interpreted as NORM_WIDTH, any value above 3 is
  4765.                    taken as THICK_WIDTH.
  4766.                 Windows:
  4767.                    Any value of linethickness between 1 and 500 is allowed,
  4768.                    useful values ranging from 1 to about 10. A minimum thick-
  4769.                    ness of one pixel is always secured, even if linethickness
  4770.                    is set to 0. Note that broken or dotted lines are plotted
  4771.                    accurately only with a linethicknes of 1. At higher values
  4772.                    of linethickness, all lines will look like solid lines.
  4773.                    Thicker lines are plotted considerably slower than thinner
  4774.                    ones.
  4775. Error handling  DOS: "silent" correction of the input value.
  4776.                 Windows: A value of linethickness greater than 500 leads to a
  4777.                 warning message "Cannot use line thicker than 500 pixels."
  4778.                 Program execution is continued with linethickness set to 500.
  4779. Return value    none
  4780. See also        VF_xyAutoPlot, V_setSymbolSize
  4781.  
  4782.  
  4783. ┌────────────────────────────────────────────────────────────────────────────┐
  4784. │ VF_setNWriteSeparate     VD_setNWriteSeparate     VE_setNWriteSeparate     │
  4785. │ VCF_setNWriteSeparate    VCD_setNWriteSeparate    VCE_setNWriteSeparate    │
  4786. │ VI_setNWriteSeparate     VSI_setNWriteSeparate                             │
  4787. │ VLI_setNWriteSeparate    VQI_setNWriteSeparate                             │
  4788. │ VU_setNWriteSeparate     VUS_setNWriteSeparate                             │
  4789. │ VUL_setNWriteSeparate    VUI_setNWriteSeparate                             │
  4790. └────────────────────────────────────────────────────────────────────────────┘
  4791. Function        Definition of the string to be used by the V.._nwrite
  4792.                 functions to separate table entries.
  4793. Syntax          #include <VFstd.h>
  4794.                 void VF_setNWriteSeparate( char *SepString );
  4795. Description     This function defines the character string to be inserted
  4796.                 between the columns of a table written by VF_nwrite.
  4797.                 VF_setNWriteSeparate does not influence the end of each
  4798.                 line which is always a line-feed character ("\n").
  4799.                 SepString may contain up to twelve characters. The default
  4800.                 setting is a tab character (#9).
  4801. Error handling  In the case of SepString longer than twelve characters,
  4802.                 the program is aborted with the error message
  4803.                 "Invalid Parameter(s)".
  4804.                 The contents of SepString is not checked.
  4805. Return value    none
  4806. See also        VF_setWriteFormat, VF_setWriteSeparate, VF_nwrite, VF_nread
  4807.  
  4808.  
  4809. ┌────────────────────────────────────────────────────────────────────────────┐
  4810. │ V_setPlotRegion                                                            │
  4811. └────────────────────────────────────────────────────────────────────────────┘
  4812. Function        Defines a screen or printer-page region to be used by
  4813.                 VectorLib plotting operations.
  4814. Syntax          #include <Vgraph.h>
  4815.                 void V_setPlotRegion( int left, int top,
  4816.                                       int right, int bottom );
  4817. Description     The rectangular region defined by the parameters, passed to
  4818.                 V_setPlotRegion, will hold the coordinate system including
  4819.                 all labels generated by future calls to VectorLib plotting
  4820.                 functions such as VF_xyAutoPlot. The parameters left, top,
  4821.                 right, and bottom are in pixels, counting from the upper
  4822.                 left corner of the screen or of the printer page.
  4823.                 V_setPlotRegion has to be called after (!) V_initPlot
  4824.                 or V_initPrint.
  4825. Error handling  none
  4826. Return value    none
  4827. See also        V_initPlot, V_initPrint
  4828.  
  4829.  
  4830. ┌────────────────────────────────────────────────────────────────────────────┐
  4831. │ V_setRadix                                                                 │
  4832. └────────────────────────────────────────────────────────────────────────────┘
  4833. Function        Define the radix for the whole-number read functions
  4834. Syntax          #include <VIstd.h>
  4835.                           /* or <VSIstd.h>, <VLIstd.h>, <VUstd.h>, ... */
  4836.                 void V_setRadix( int radix );
  4837. Description     By default, the V.._read functions for the whole-number data
  4838.                 types interpret all numbers as decimal numbers. V_setRadix
  4839.                 allows to change this default behaviour.
  4840.                 The radix set by V_setRadix will be used in VI_read, VI_nread
  4841.                 and their VSI_, VLI_, VUS_, VU_, VUL_, and VUL_ analogues.
  4842.                 It does, however, not affect VQI_read or VQI_nread (where the
  4843.                 radix is always 10).
  4844.  
  4845.                 radix may take on values between 2 and 36 or 0.
  4846.                 In the case of radix=0, the basis of each number is determined
  4847.                 at run-time:
  4848.                 All numbers beginning with the ciphers 1-9 are recognized
  4849.                 as decimal numbers.
  4850.                 All numbers beginning with "0x" are interpreted as
  4851.                 hexadecimal and all numbers beginning with "0" without "x"
  4852.                 are read as octal numbers.
  4853. Error handling  radix < 0, radix=1, or radix > 36 lead to a program abort
  4854.                 with the error message "Invalid Parameter(s)".
  4855. Return value    none
  4856. See also        VI_read, VI_nread, strtol, strtoul
  4857.  
  4858.  
  4859. ┌────────────────────────────────────────────────────────────────────────────┐
  4860. │ VF_setRspEdit            VD_setRspEdit            VE_setRspEdit            │
  4861. └────────────────────────────────────────────────────────────────────────────┘
  4862. Function        Modify the treatment of round-off errors in VF_convolve
  4863.                 and  VF_deconvolve
  4864. Syntax          #include <VFstd.h>
  4865.                 void  VF_setRspEdit( fComplex Trunc );
  4866. Description     In the functions VF_convolve and VF_deconvolve, a frequency
  4867.                 filter is calculated by Fourier-transforming a given response
  4868.                 function. The filter is then applied to a vector. Due to
  4869.                 accumulated round-off, filter elements that should be zero
  4870.                 may be not so, but contain small non-zero numbers.
  4871.  
  4872.                 The maximum round-off error in the construction of Flt
  4873.                 accumulates roughly to (size * big * prec), where big is the
  4874.                 largest element of Flt and prec the relative floating-point
  4875.                 precision. Any element smaller than that should be regarded as
  4876.                 zero. In order to determine the exact threshold for the real
  4877.                 and imaginary parts separately, the function uses the real
  4878.                 and imaginary parts of Trunc, substituting them for prec in
  4879.                 the above expression. Normally, you would choose
  4880.                 Trunc.Re = Trunc.Im,  although a stricter (i.e. larger)
  4881.                 value for Trunc.Im is also reasonable.
  4882.  
  4883.                 By default, Trunc.Re = 16*EPSILON and Trunc.Im = 32*EPSILON,
  4884.                 where EPSILON is FLT_EPSILON, DBL_EPSILON, or LDBL_EPSILON
  4885.                 (these constants are defined in <float.h>), depending on
  4886.                 the data type.
  4887.  
  4888.                 In order to switch the editing of the filter completely off,
  4889.                 choose Trunc.Re = Trunc.Im = 0.
  4890.  
  4891.                 During convolutions, the editing of the filter leads to
  4892.                 slightly smoother results. During deconvolutions, the
  4893.                 editing has also another meaning: for all "lost" frequencies
  4894.                 (i.e., those for which the Fourier transform of the response
  4895.                 function contains only numbers near zero), the filter is set
  4896.                 to 0 instead of the inverse of these small numbers. Thereby,
  4897.                 possible OVERFLOW and SING errors are avoided.
  4898.  
  4899.                 To read the currently set threshold, call VF_getRspEdit.
  4900. Error handling  none
  4901. Return value    none
  4902. See also        VF_convolve,  VF_deconvolve, VF_getRspEdit
  4903.  
  4904.  
  4905. ┌────────────────────────────────────────────────────────────────────────────┐
  4906. │ V_setSymbolSize                                                            │
  4907. └────────────────────────────────────────────────────────────────────────────┘
  4908. Function        Modify the size of the symbols used in plotting functions
  4909. Syntax          #include <Vgraph.h>
  4910.                 void V_setSymbolSize( float symsiz );
  4911. Description     The size of the symbols used in the plotting functions
  4912.                 VF_xyAutoPlot, VCF_autoPlot, etc., is modified by scaling with
  4913.                 symsiz. To reset the symbol size to the default value, call
  4914.                 V_setSymbolSize with symsiz=1.0. Note that it is not possible
  4915.                 to make the symbols completely vanish (e.g., by setting
  4916.                 symsiz = 0.0), since a minimum radius of one pixel is always
  4917.                 secured. Useful values of symsiz range from about 0.5 to 5.0.
  4918.                 Values above 50.0 are prohibited.
  4919.  
  4920.                 When magnifying the symbols, you should also consider modifying
  4921.                 the thickness of the connecting lines, if you are using any.
  4922.                 See V_setLineThickness.
  4923.  
  4924.                 Notice: An automatic scaling is always performed in order to
  4925.                 maintain a constant relation between the symbol size and the
  4926.                 overall size of the coordinate grid (which is especially
  4927.                 important for Windows applications). The factor symsiz of this
  4928.                 function scales the symbol size with respect to the
  4929.                 automatically-found value. The automatic scaling cannot be
  4930.                 switched off.
  4931. Error handling  DOS: "silent" correction of the input value.
  4932.                 Windows: A value of symsiz greater than 50.0 leads to a
  4933.                 warning message "Cannot scale symbols by more than a factor
  4934.                 of 50.0". Program execution is continued with symsiz set
  4935.                 to 50.0.
  4936. Return value    none
  4937. See also        VF_xyAutoPlot, V_setLineThickness
  4938.  
  4939.  
  4940. ┌────────────────────────────────────────────────────────────────────────────┐
  4941. │ VF_setWriteFormat        VD_setWriteFormat        VE_setWriteFormat        │
  4942. │ VCF_setWriteFormat       VCD_setWriteFormat       VCE_setWriteFormat       │
  4943. │ VI_setWriteFormat        VSI_setWriteFormat                                │
  4944. │ VLI_setWriteFormat       VQI_setWriteFormat                                │
  4945. │ VU_setWriteFormat        VUS_setWriteFormat                                │
  4946. │ VUL_setWriteFormat       VUI_setWriteFormat                                │
  4947. └────────────────────────────────────────────────────────────────────────────┘
  4948. Function        Definition of the format to be used by V.._write and
  4949.                 V.._nwrite
  4950. Syntax          #include <VFstd.h>
  4951.                 void VF_setWriteFormat( char *FormatString );
  4952. Description     The functions of the VF_write and VF_nwrite families employ
  4953.                 internally the ANSI C function fprintf in order to print
  4954.                 numbers into a stream.
  4955.                 According to the rules described in the documentation of
  4956.                 Borland C++ for printf, the format may be specified as fits
  4957.                 your needs. When defining a write format, one should always
  4958.                 be aware of the restrictions imposed by the read functions
  4959.                 (not all formats you can write will be read correcly, see
  4960.                 VF_read).
  4961.  
  4962.                 VF_setWriteFormat should not be used for the definition of
  4963.                 whitespace before or after the numbers. This is the task
  4964.                 of VF_setWriteSeparate.
  4965.  
  4966.                 For details about the formats used for each of the various
  4967.                 data types, please refer to the following table. The last
  4968.                 column of this table gives the maximum length of the format
  4969.                 string.
  4970.  
  4971.    │ Version │     Standard Format    │    Alternative Example  │max.length │
  4972.    ├─────────┼────────────────────────┼─────────────────────────┼───────────┤
  4973.    │ VF_     │              "% 11.8e" │                "% 8.4f" │     16    │
  4974.    │ VD_     │            "% 19.16le" │              "% 16.8lf" │     16    │
  4975.    │ VE_     │            "% 22.19Le" │             "% 22.19LG" │     16    │
  4976.    │ VCF_    │     "% 11.8e, % 11.8e" │      "{% 8.4f, % 8.4f}" │     32    │
  4977.    │ VCD_    │ "% 19.16le, % 19.16le" │ "{% 19.16lE % 19.16lE}" │     32    │
  4978.    │ VCE_    │ "% 22.19Le, % 22.19Le" │ "{% 22.19Lg % 22.19Lg}" │     32    │
  4979.    │ VI_     │                 "% 5d" │                "0x% 4x" │     12    │
  4980.    │ VSI_    │                "% 5hd" │               "0x% 4hX" │     12    │
  4981.    │ VLI_    │               "% 10ld" │                "%08lXh" │     12    │
  4982.    │ VQI_    │             "% 20.0Lf" │                         │     16    │
  4983.    │ VU_     │                 "% 5u" │                 "%04xh" │     12    │
  4984.    │ VUS_    │                "% 5hu" │                "0%04ho" │     12    │
  4985.    │ VUL_    │               "% 10lu" │                "0%08lO" │     12    │
  4986.    └─────────┴────────────────────────┴─────────────────────────┴───────────┘
  4987.  
  4988.                 The data type quad is converted into extended before
  4989.                 being passed to fprintf (which, at present, does not
  4990.                 support quads). This explains why the format string in
  4991.                 the VQI_ version tells fprintf to expect a long double.
  4992.  
  4993.                 In the memory model FLAT of the registered version of
  4994.                 VectorLib, the VI_ variant gets the standard format "% 10d"
  4995.                 and the VU_ variant gets the standard format "% 10u".
  4996. Error handling  Format strings longer than the maximum length specified
  4997.                 in the above table lead to a program abort with the error
  4998.                 message "Invalid Parameter(s)".
  4999.                 The contents of the format string is not checked. So you
  5000.                 have to be very careful to specify a format which is valid
  5001.                 for the respective data type.
  5002. Return value    none
  5003. See also        VF_setWriteSeparate, VF_write, VF_nwrite, VF_read, VF_nread
  5004.  
  5005.  
  5006. ┌────────────────────────────────────────────────────────────────────────────┐
  5007. │ VF_setWriteSeparate      VD_setWriteSeparate      VE_setWriteSeparate      │
  5008. │ VCF_setWriteSeparate     VCD_setWriteSeparate     VCE_setWriteSeparate     │
  5009. │ VI_setWriteSeparate      VSI_setWriteSeparate                              │
  5010. │ VLI_setWriteSeparate     VQI_setWriteSeparate                              │
  5011. │ VU_setWriteSeparate      VUS_setWriteSeparate                              │
  5012. │ VUL_setWriteSeparate     VUI_setWriteSeparate                              │
  5013. └────────────────────────────────────────────────────────────────────────────┘
  5014. Function        Definition of the separation string used by V.._write
  5015. Syntax          #include <VFstd.h>
  5016.                 void VF_setWriteSeparate( char *SepString );
  5017. Description     By default, VF_write puts a line feed character after each
  5018.                 vector element written into a stream. This means that each
  5019.                 element gets its own line. You may use VF_setWriteSeparate
  5020.                 to define another separation string. This may be, for
  5021.                 example, a tab character ("\t") or a series of spaces
  5022.                 (e.g., "    ").
  5023.                 If you use VF_write with the output sent directly to the
  5024.                 printer (stream = stdprn), you probably have to explicitly
  5025.                 use a carriage return character in addition to the line
  5026.                 feed. To do this, call
  5027.                       VF_setWriteSeparate( "\n\r" );
  5028.  
  5029.                 VF_write will insert the separation string only in between
  5030.                 the vector elements. At the end, after the last element,
  5031.                 there is always a line feed ("\n") instead of the separation
  5032.                 string.
  5033.  
  5034.                 SepString may contain up to twelve characters.
  5035. Error handling  In the case of SepString longer than twelve characters,
  5036.                 the program is aborted with the error message
  5037.                 "Invalid Parameter(s)".
  5038.                 The contents of SepString is not checked.
  5039. Return value    none
  5040. See also        VF_setWriteFormat, VF_setNWriteSeparate, VF_write, VF_read
  5041.  
  5042.  
  5043. ┌────────────────────────────────────────────────────────────────────────────┐
  5044. │ VF_sgn                   VD_sgn                   VE_sgn                   │
  5045. └────────────────────────────────────────────────────────────────────────────┘
  5046. Function        Signum function, compares each element of a vector with 0.
  5047. Syntax          #include <VFmath.h>
  5048.                 void VF_sgn( fVector Y, fVector X, ui size );
  5049. Description     Each element of X is compared with 0 and the result of the
  5050.                 comparison stored in Y:
  5051.                    Yi  =  +1.0,    if  Xi > 0
  5052.                    Yi  =   0.0,    if  Xi = 0
  5053.                    Yi  =  -1.0,    if  Xi < 0.
  5054.                 This function is implemented as a macro that calls VF_cmp0.
  5055. Error handling  none
  5056. Return value    none
  5057. See also        VF_cmp_..., VF_cmpC, VF_cmpV
  5058.  
  5059.  
  5060. ┌────────────────────────────────────────────────────────────────────────────┐
  5061. │ VI_shl              VSI_shl             VLI_shl             VQI_shl        │
  5062. │ VU_shl              VUS_shl             VUL_shl             VUI_shl        │
  5063. └────────────────────────────────────────────────────────────────────────────┘
  5064. Function        "Shift to the left", i.e. multiply by integer powers of 2.
  5065. Syntax          #include <VImath.h>
  5066.                 void VI_shl(  iVector Y, iVector X, ui size, unsigned C );
  5067.                 void VUL_shl( ulVector Y, ulVector X, ui size, unsigned C );
  5068.                     (similarly all other functions of this family)
  5069. Description     Yi  =  Xi  <<  C
  5070.                 All bits of Xi are shifted to the left by as many positions as
  5071.                 indicated in the parameter C. This corresponds to a
  5072.                 multiplication by 2**C, neglecting possible overflow (in all
  5073.                 versions) and loss of the sign bit (for signed numbers, i.e.
  5074.                 in the VI_, VSI_, VLI_, and VQI_ versions). Note that by
  5075.                 shifting 16-bit numbers (VSI_, VUS_ versions) by more than 15
  5076.                 positions, any non-zero bit present in the original number is
  5077.                 lost and the result is 0. Similarly, 32-bit numbers (VLI_,
  5078.                 VUL_ versions) yield 0 upon shifting by more than 31
  5079.                 positions.  C is always of the data type unsigned. Shifting by
  5080.                 negative numbers C is, therefore, not possible. To perform a
  5081.                 right-shift, the appropriate function of the VI_shr family
  5082.                 has to be used.
  5083. Error handling  none
  5084. Return value    none
  5085. See also        VI_mul,  VI_shr
  5086.  
  5087.  
  5088. ┌────────────────────────────────────────────────────────────────────────────┐
  5089. │ VI_shr              VSI_shr             VLI_shr             VQI_shr        │
  5090. │ VU_shr              VUS_shr             VUL_shr             VUI_shr        │
  5091. └────────────────────────────────────────────────────────────────────────────┘
  5092. Function        "Shift to the right", i.e., divide by integer powers of 2.
  5093. Syntax          #include <VImath.h>
  5094.                 void VI_shr(  iVector  Y, iVector  X,  ui size,    unsigned C );
  5095.                 void VUL_shr( ulVector Y, ulVector X,  ui size, unsigned C );
  5096.                    (similarly all other functions of this family)
  5097. Description     Yi  =  Xi  >>  C
  5098.                 All bits of Xi are shifted to the right by as many positions
  5099.                 as indicated in the parameter C. This corresponds to an
  5100.                 integer division by 2**C. The sign of Yi is always the same as
  5101.                 of Xi. In contrast to explicit integer divisions, the result
  5102.                 is always rounded toward minus infinity:  -15 / 2 = -7,  but
  5103.                 -15 >> 1 = -8. Note that by shifting 16-bit numbers (VSI_,
  5104.                 VUS_ versions) by more than 15 positions, any unsigned or
  5105.                 positive number yields 0, whereas any negative number (in the
  5106.                 VSI_ version) yields -1 in this case. The same is true for 32-
  5107.                 bit numbers (VLI_, VUL_ versions) upon shifting by more than
  5108.                 31 positions. C is always of the data type unsigned. Shifting
  5109.                 by negative numbers C is, therefore, not possible. To perform
  5110.                 a left-shift, the appropriate function of the VI_shl family
  5111.                 has to be used.
  5112. Error handling  none
  5113. Return value    none
  5114. See also        VI_div,  VI_shl
  5115.  
  5116.  
  5117. ┌────────────────────────────────────────────────────────────────────────────┐
  5118. │ VF_sin                   VD_sin                   VE_sin                   │
  5119. │ VCF_sin                  VCD_sin                  VCE_sin                  │
  5120. │ VFx_sin                  VDx_sin                  VEx_sin                  │
  5121. │ VCFx_sin                 VCDx_sin                 VCEx_sin                 │
  5122. └────────────────────────────────────────────────────────────────────────────┘
  5123. Function        Sine function
  5124. Syntax          #include <VFmath.h>
  5125.                 int  VF_sin(  fVector  Y,  fVector  X, ui size );
  5126.                 int  VFx_sin( fVector  Y,  fVector  X, ui size,
  5127.                               float A, float B, float C );
  5128. Description     normal versions:    Yi =  sin( Xi )
  5129.                 expanded versions:  Yi =  C *  sin( A*Xi+B )
  5130.                 For large values of Xi, round-off error becomes appreciable;
  5131.                 if the Xi values are representable as fractional multiples of
  5132.                 Pi, it is better to use VF_sinrpi  than VF_sin.
  5133. Error handling  Precision errors lead to a default result of 0.0 and a non-
  5134.                 zero return value, but are ignored otherwise; _matherr is
  5135.                 not called.
  5136.                 OVERFLOW errors can only occur in the complex versions and
  5137.                 lead to a result of ±HUGE_VAL.
  5138. Return value    0, if no error occurred, otherwise non-zero
  5139. See also        VF_sin2,  VF_sinrpi,  VF_cos,  VF_sinh,  VF_asin,  sin
  5140.  
  5141.  
  5142. ┌────────────────────────────────────────────────────────────────────────────┐
  5143. │ VF_sin2                  VD_sin2                  VE_sin2                  │
  5144. │ VFx_sin2                 VDx_sin2                 VEx_sin2                 │
  5145. └────────────────────────────────────────────────────────────────────────────┘
  5146. Function        Square of the sine function
  5147. Syntax          #include <VFmath.h>
  5148.                 int  VF_sin2(  fVector  Y,  fVector  X, ui size );
  5149.                 int  VFx_sin2( fVector  Y,  fVector  X, ui size,
  5150.                                float A, float B, float C );
  5151. Description     normal versions:    Yi  =  sin²( Xi )
  5152.                 expanded versions:  Yi  =  C *  sin²( A*Xi+B )
  5153.                 Calculating the squared trigonometric functions directly is
  5154.                 faster and sometimes more accurate than first calculating the
  5155.                 trigonometric function itself and squaring it afterwards.
  5156. Error handling  Precision errors lead to a default result of 0.0 and a non-
  5157.                 zero return value, but are otherwise ignored; _matherr is not
  5158.                 called.
  5159.                 OVERFLOW errors can only occur in the complex versions and
  5160.                 lead to a result of ±HUGE_VAL.
  5161. Return value    0, if no error occurred, otherwise non-zero.
  5162. See also        VF_sin,   VF_sinrpi,   sin
  5163.  
  5164.  
  5165. ┌────────────────────────────────────────────────────────────────────────────┐
  5166. │ VF_sinc                  VD_sinc                  VE_sinc                  │
  5167. │ VFx_sinc                 VDx_sinc                 VEx_sinc                 │
  5168. └────────────────────────────────────────────────────────────────────────────┘
  5169. Function        Sinc function
  5170. Syntax          #include <VFmath.h>
  5171.                 int  VF_sinc(  fVector  Y,  fVector  X, ui size );
  5172.                 int  VFx_sinc( fVector  Y,  fVector  X, ui size,
  5173.                                float A, float B, float C );
  5174. Description     normal versions:    Yi =  sinc( Xi )  =  sin( Xi ) / Xi
  5175.                 expanded versions:  Yi = C * sinc( A*Xi+B )
  5176.                 The sinc function for an argument of 0.0 is defined as 1.0.
  5177.                 The sinc function is the Fourier transform of a square pulse
  5178.                 and is used, for example, to describe the diffraction pattern
  5179.                 of a slit.
  5180. Error handling  These functions should be error-proof.
  5181. Return value    always 0.
  5182. See also        VF_sin,   VF_sinrpi,   sin
  5183.  
  5184.  
  5185. ┌────────────────────────────────────────────────────────────────────────────┐
  5186. │ VF_sincos                VD_sincos                VE_sincos                │
  5187. │ VFx_sincos               VDx_sincos               VEx_sincos               │
  5188. └────────────────────────────────────────────────────────────────────────────┘
  5189. Function        Sine and Cosine simultaneously
  5190. Syntax          #include <VFmath.h>
  5191.                 int  VF_sincos( fVector  YSin,  fVector YCos,
  5192.                                 fVector  X, ui size );
  5193.                 int  VFx_sincos( fVector  YSin,  fVector YCos,
  5194.                                  fVector  X, ui size,
  5195.                                  float A, float B, float C );
  5196. Description     normal versions:   YSin[i]  =  sin( Xi )
  5197.                                    YCos[i]  =  cos( Xi )
  5198.                 expanded versions: YSin[i]  =  C *  sin( A*Xi+B )
  5199.                                    YCos[i]  =  C *  cos( A*Xi+B )
  5200.                 The sine and the cosine are calculated simultaneously, which
  5201.                 is far more efficient than calculating them separately if both
  5202.                 of them are needed. For large values of Xi, round-off error
  5203.                 becomes appreciable; if the Xi values are representable as
  5204.                 fractional multiples of Pi, it is better to use VF_sincosrpi
  5205.                 than VF_sincos.
  5206. Error handling  Precision errors lead to a result of 0.0 for the sine and 1.0
  5207.                 for the cosine (as if the input were 0.0) along with a non-
  5208.                 zero return value, but are otherwise ignored; _matherr is not
  5209.                 called. Other errors should not occur.
  5210. Return value    0, if no error occurred, otherwise non-zero.
  5211. See also        VF_sincos2,  VF_sincosrpi,  sin,  cos
  5212.  
  5213.  
  5214. ┌────────────────────────────────────────────────────────────────────────────┐
  5215. │ VF_sincos2               VD_sincos2               VE_sincos2               │
  5216. │ VFx_sincos2              VDx_sincos2              VEx_sinco2               │
  5217. └────────────────────────────────────────────────────────────────────────────┘
  5218. Function        Square of the sine and of the cosine simultaneously
  5219. Syntax          #include <VFmath.h>
  5220.                 int  VF_sincos2(  fVector YSin2, fVector YCos2,
  5221.                                   fVector  X, ui size );
  5222.                 int  VFx_sincos2( fVector YSin2, fVector YCos2,
  5223.                                   fVector  X, ui size,
  5224.                                   float A, float B, float C );
  5225. Description     normal versions:    YSin2[i]  =  sin²( Xi )
  5226.                                     YCos2[i]  =  cos²( Xi )
  5227.                 expanded versions:  YSin2[i]  =  C * sin²( A*Xi+B )
  5228.                                     YCos2[i]  =  C * cos²( A*Xi+B )
  5229.                 The squared sine and the squared cosine are calculated
  5230.                 simultaneously, which is far more efficient than calculating
  5231.                 them separately, if both of them are needed.
  5232. Error handling  Precision errors lead to a result of 0.0 for the sin² and of
  5233.                 1.0 for the cos² (as if the input were 0.0) along with a non-
  5234.                 zero return value, but are otherwise ignored; _matherr is not
  5235.                 called. Other errors should not occur.
  5236. Return value    0, if no error occurred, otherwise non-zero.
  5237. See also        VF_sincos,   sin,  cos
  5238.  
  5239.  
  5240. ┌────────────────────────────────────────────────────────────────────────────┐
  5241. │ VF_sincosrpi             VD_sincosrpi             VE_sincosrpi             │
  5242. │ VF_sincosrpi2            VD_sincosrpi2            VE_sincosrpi2            │
  5243. │ VF_sincosrpi3            VD_sincosrpi3            VE_sincosrpi3            │
  5244. └────────────────────────────────────────────────────────────────────────────┘
  5245. Function        Sine and cosine of fractional multiples of Pi
  5246. Syntax          #include <VFmath.h>
  5247.                 int  VF_sincosrpi(   fVector  YSin,  fVector YCos,
  5248.                                      iVector  P, ui size,  int q );
  5249.                 int  VF_sincosrpi2(  fVector  YSin,  fVector YCos,
  5250.                                      iVector  P, ui size,  int q );
  5251.                 int  VF_sincosrpi3(  fVector  YSin,  fVector YCos,
  5252.                                      iVector  P, ui size,  int q );
  5253. Description     YSin[i]  =  sin( (P[i] / q) * Pi )
  5254.                 YCos[i]  =  cos( (P[i] / q) * Pi )
  5255.                 The sine and the cosine of fractional multiples of Pi are
  5256.                 calculated. There are three versions: VF_sincosrpi is for
  5257.                 general use with any arbitrary denominator q. If q is a power
  5258.                 of 2,  VF_sincosrpi2 should be used which is a highly
  5259.                 optimized version reading the results from a table named
  5260.                 VF_sintab2, if possible. If q is a multiple of 3,
  5261.                 VF_sincosrpi3 should be used which utilizes a table named
  5262.                 VF_sintab3. The use of VF_sincosrpi3 is a convenient way to
  5263.                 use degrees instead of radians; if, for example, q is 180,
  5264.                 then the unit of the elements of P is "degree". VF_sincosrpi2
  5265.                 and VF_sincosrpi3 work also with q values they are not
  5266.                 optimized for; in this case, however, memory space is wasted
  5267.                 for the (then useless) tables.
  5268. Error handling  These functions should be error-proof, as long as q!=0.
  5269. Return value    always 0
  5270. See also        VF_sincos,    sin, cos
  5271.  
  5272.  
  5273. ┌────────────────────────────────────────────────────────────────────────────┐
  5274. │ VF_sinh                  VD_sinh                  VE_sinh                  │
  5275. │ VCF_sinh                 VCD_sinh                 VCE_sinh                 │
  5276. │ VFx_sinh                 VDx_sinh                 VEx_sinh                 │
  5277. │ VCFx_sinh                VCDx_sinh                VCEx_sinh                │
  5278. └────────────────────────────────────────────────────────────────────────────┘
  5279. Function        Hyperbolic sine function
  5280. Syntax          #include <VFmath.h>
  5281.                 int  VF_sinh(  fVector  Y,  fVector  X, ui size );
  5282.                 int  VFx_sinh( fVector  Y,  fVector  X, ui size,
  5283.                                float A, float B, float C );
  5284. Description     normal versions:      Yi  =  sinh( Xi )
  5285.                 expanded versions:    Yi  =  C * sinh ( A*Xi+B )
  5286. Error handling  OVERFLOW errors lead to a default result of ±HUGE_VAL.
  5287. Return value    0, if no error occurred, otherwise non-zero.
  5288. See also        VF_cosh,  VF_exp,   sinh
  5289.  
  5290.  
  5291. ┌────────────────────────────────────────────────────────────────────────────┐
  5292. │ VF_sinrpi                VD_sinrpi                VE_sinrpi                │
  5293. │ VF_sinrpi2               VD_sinrpi2               VE_sinrpi2               │
  5294. │ VF_sinrpi3               VD_sinrpi3               VE_sinrpi3               │
  5295. └────────────────────────────────────────────────────────────────────────────┘
  5296. Function        Sine function of fractional multiples of Pi
  5297. Syntax          #include <VFmath.h>
  5298.                 int  VF_sinrpi(  fVector Y, iVector P, ui size, int q );
  5299.                 int  VF_sinrpi2( fVector Y, iVector P, ui size, int q );
  5300.                 int  VF_sinrpi3( fVector Y, iVector P, ui size, int q );
  5301. Description     Yi  =  sin( (P[i] / q) * Pi )
  5302.                 The sine of fractional multiples of Pi is calculated. There
  5303.                 are three versions: VF_sinrpi is for general use with any
  5304.                 arbitrary denominator q. If q is a power of 2,  VF_sinrpi2
  5305.                 should be used which is a highly optimized version reading
  5306.                 the results from a look-up table, if possible. If q is a
  5307.                 multiple of 3,  VF_sinrpi3 should be used.  VF_sinrpi3 offers
  5308.                 a convenient way to use degrees instead of radians; if, for
  5309.                 example, q is 180, then the unit of the elements of P is
  5310.                 "degree".  VF_sinrpi2 and VF_sinrpi3 work also with q values
  5311.                 they are not optimized for; in this case, however, memory
  5312.                 space is wasted for the tables.
  5313. Error handling  These functions should be error-proof, as long as q!=0.
  5314. Return value    always 0
  5315. See also        VF_sin,    sin
  5316.  
  5317.  
  5318. ┌────────────────────────────────────────────────────────────────────────────┐
  5319. │ VF_sintab2               VD_sintab2               VE_sintab2               │
  5320. │ VF_sintab3               VD_sintab3               VE_sintab3               │
  5321. └────────────────────────────────────────────────────────────────────────────┘
  5322.                 Table of sine values for arguments between 0 and Pi/2
  5323. Syntax          #include <xmath.h>
  5324.                 extern float     VF_sintab2[ VF_tabsz2+1 ];
  5325.                 extern double    VD_sintab2[ VD_tabsz2+1 ];
  5326.                 extern extended  VE_sintab2[ VE_tabsz2+1 ];
  5327.                 extern float     VF_sintab3[ VF_tabsz3+1 ];
  5328.                 extern double    VD_sintab3[ VD_tabsz3+1 ];
  5329.                 extern extended  VE_sintab3[ VE_tabsz3+1 ];
  5330. Description     VF_sintab2[ i ]  =  sin( i/(2*VF_tabsz2) * Pi ),
  5331.                                                       i=0,...,VF_tabsz2
  5332.                 VF_sintab3[ i ]  =  sin( i/(2*VF_tabsz3) * Pi ),
  5333.                                                       i=0,...,VF_tabsz3
  5334.                 These look-up tables of sine values for arguments between 0
  5335.                 and Pi/2 are used by VF_sinrpi2 and the other functions of
  5336.                 that family and are also available for other purposes.
  5337.                 The symbols VF_tabsz2 etc., denoting the size of the tables,
  5338.                 are defined in <xmath.h>.
  5339. See also        VF_sinrpi2,  VF_tantab2,  VF_cosectab2
  5340.  
  5341.  
  5342. ┌────────────────────────────────────────────────────────────────────────────┐
  5343. │ VF_sort                  VD_sort                  VE_sort                  │
  5344. │ VI_sort             VSI_sort            VLI_sort            VQI_sort       │
  5345. │ VU_sort             VUS_sort            VUL_sort            VUI_sort       │
  5346. └────────────────────────────────────────────────────────────────────────────┘
  5347. Function        Sorting into ascending or descending order
  5348. Syntax          #include <VFstd.h>
  5349.                 void  VF_sort( fVector Y, fVector X, ui size, int dir );
  5350. Description     The vector is sorted in ascending order, if dir is positive;
  5351.                 negative dir yields descending order. The present
  5352.                 implementation uses the "Heapsort" algorithm.
  5353. Error handling  none
  5354. Return value    none
  5355. See also        VF_sortind,  VF_rotate, VF_rev,  qsort
  5356.  
  5357.  
  5358. ┌────────────────────────────────────────────────────────────────────────────┐
  5359. │ VF_sortind               VD_sortind               VE_sortind               │
  5360. │ VI_sortind          VSI_sortind         VLI_sortind         VQI_sortind    │
  5361. │ VU_sortind          VUS_sortind         VUL_sortind         VUI_sortind    │
  5362. └────────────────────────────────────────────────────────────────────────────┘
  5363. Function        Sort the index-array of a vector
  5364. Syntax          #include <VFstd.h>
  5365.                 void VF_sortind( uiVector Ind,  fVector X, ui size, int dir );
  5366. Description     The routine is similar to VF_sort, but this time it is the
  5367.                 index-array of X rather than the vector X itself that is
  5368.                 ordered. Ascending order is obtained by setting dir to any
  5369.                 positive number. Here, ascending order means that Ind[0] will
  5370.                 contain the index of the smallest element of X, Ind[1] the
  5371.                 index of the second-smallest, and so on, up to Ind[size-1],
  5372.                 the index of the largest element in X. Descending order is
  5373.                 obtained by setting dir negative. This routine is used if
  5374.                 other vectors are correlated with X and the correlation of the
  5375.                 individual elements has to be maintained. After sorting the
  5376.                 index-array, use VF_indpick (VD_indpick, VI_indpick, etc.) to
  5377.                 actually perform the sorting of X and the other vectors
  5378.                 correlated with X.
  5379. Error handling  none
  5380. Return value    none
  5381. See also        VF_sort, VF_indpick
  5382.  
  5383.  
  5384. ┌────────────────────────────────────────────────────────────────────────────┐
  5385. │ VF_spectrum              VD_spectrum              VE_spectrum              │
  5386. └────────────────────────────────────────────────────────────────────────────┘
  5387. Function        Power-density spectrum
  5388. Syntax          #include <VFstd.h>
  5389.                 float VF_spectrum(  fVector Spc,  ui specsiz,
  5390.                                     fVector X,  ui xsiz, fVector Win );
  5391. Description     The data set X is analyzed for its power spectral density
  5392.                 (PSD), i.e. the mean square amplitude. The result is stored
  5393.                 in Spc.  xsiz must be at least 2*specsiz, and specsiz has to
  5394.                 be an integer power of 2.   Internally, X is divided into
  5395.                 xsiz*specsiz/2 segments and the average over the spectra of
  5396.                 the individual segments is calculated. Each segment of length
  5397.                 2*specsiz yields the PSD for specsiz+1 frequencies (see
  5398.                 VF_FFT). In order to keep specsiz an integer power of 2, there
  5399.                 are only specsiz points stored in Spc and the last one, the
  5400.                 PSD at the Nyquist frequency, is given as the return value
  5401.                 of the function and may either be neglected (by calling the
  5402.                 function like a void function) or stored as the last element
  5403.                 in Spc by calling the function as
  5404.                    Spc[specsiz] = VF_spectrum( Spc, specsiz, X, xsiz, Win );
  5405.                 in this case, Spc must have a length of specsiz+1.
  5406.  
  5407.                 Win is a window that is applied to the data segments. The size
  5408.                 of the Win vector must be 2*specsiz. Within the VectorLib
  5409.                 library, three functions are available that give suitable
  5410.                 Windows: VF_Welch, VF_Parzen, and VF_Hanning. A square window
  5411.                 (i.e. no windowing at all) is achieved by setting all elements
  5412.                 of Win to 1.0 using VF_equ1. Use of the square window is not
  5413.                 recommended here, though.
  5414.  
  5415.                 You may wish to test the quality of the calculated spectrum by
  5416.                 applying the Wiener-Khinchin theorem (provided you called
  5417.                 VF_spectrum as in the above example and stored the PSD for the
  5418.                 Nyquist frequency):
  5419.                 1.0/xsize * VF_ssq( X, xsize ) must be about equal to
  5420.                 VF_sum( Spc, specsiz+1 ).
  5421.                 If the deviation between both results is large, the sampling
  5422.                 interval in X probably is too large.
  5423.  
  5424.                 About special versions with the prefixes  VFs_  and VFl_,
  5425.                 consult chapter 4.8.
  5426. Example (for DOS):
  5427.                 #include <VFstd.h>
  5428.                 #include <VFmath.h>
  5429.                 #include <Vgraph.h>
  5430.                 #include <math.h>
  5431.                 #include <conio.h>
  5432.                 void main( void )
  5433.                 {
  5434.                     fVector  X,   Spc,  Win,  Time,   Freq;
  5435.                     ui       xsize=1024,  specsiz=128;
  5436.                     X    = VF_vector( xsize );
  5437.                     Spc  = VF_vector( specsiz+1 );
  5438.                     Win  = VF_vector( 2*specsiz );
  5439.                     Time = VF_vector( xsize );
  5440.                     Freq = VF_vector( specsiz+1);
  5441.  
  5442.                     VF_ramp( Time, xsize, 0.0, 200 * M_PI / xsize );
  5443.                     VF_ramp( Freq, specsiz+1,  0.0, (xsize / (200*M_PI)) /
  5444.                              specsiz );
  5445.                        /* get a Time axis from 0 to 200 Pi and a corresponding
  5446.                           frequency axis from 0 to the Nyquist frequency */
  5447.                     VF_sin( X, Time, xsize );    /* 100 periods of a sine */
  5448.                     VF_cmpC( X, X, xsize, 0.5 );
  5449.                                   /* convert into asymmetric square wave */
  5450.                     VF_Welch( Win, 2*specsiz );   /* or another window */
  5451.                     Spc[specsiz] = VF_spectrum( Spc, specsiz, X, xsize, Win );
  5452.                     V_initGraph( "\\BorlandC\\BGI\\" );
  5453.                                        /* give the correct BGI path! */
  5454.                     VF_xyAutoPlot( Freq, Spc, specsiz+1,
  5455.                                    PS_SOLID | SY_CROSS, GREEN );
  5456.                     getch();   /* hit any key when you have seen enough */
  5457.                     closegraph();
  5458.                     V_nfree( 5, Freq, Time, Win, Spc, X );
  5459.                 }
  5460. Error handling  If size is not a power of 2,  VF_FFT  (on which VF_spectrum
  5461.                 is based) complains "Size must be an integer power of 2"
  5462.                 and the program is aborted.
  5463. Return value    PSD at the Nyquist frequency
  5464. See also        VF_FFT, VF_convolve, VF_autocorr, VF_xcorr, VF_filter
  5465.  
  5466.  
  5467. ┌────────────────────────────────────────────────────────────────────────────┐
  5468. │ VF_splinederiv2          VD_splinederiv2          VE_splinederiv2          │
  5469. └────────────────────────────────────────────────────────────────────────────┘
  5470. Function        Generate a second-derivative table from an X-Y-table to be
  5471.                 used for cubic-spline interpolation.
  5472. Syntax          #include <VFstd.h>
  5473.                 void  VF_splinederiv2(
  5474.                                 fVector Y2,
  5475.                                 fVector XTab, fVector YTab, ui size,
  5476.                                 int specify,  float Yp0, float Ypn );
  5477. Description     A table of second derivatives of YTab is generated to be used
  5478.                 for cubic-spline interpolation with VF_splineinterpol. In
  5479.                 order to get a unique solution, two additional conditions have
  5480.                 to be specified. Setting specify to 0 yields the "natural
  5481.                 cubic spline" with Y2 being set to zero at both end-points; in
  5482.                 this case, Yp0 and Ypn have no influence. Setting specify to 1
  5483.                 yields Y2 calculated in such a way that the first(!)
  5484.                 derivative at the zeroth and at the last position equals Yp0
  5485.                 and Ypn, resp.
  5486. Error handling  none
  5487. Return value    none
  5488. See also        VF_splineinterpol
  5489.  
  5490.  
  5491. ┌────────────────────────────────────────────────────────────────────────────┐
  5492. │ VF_splineinterpol        VD_splineinterpol        VE_splineinterpol        │
  5493. └────────────────────────────────────────────────────────────────────────────┘
  5494. Function        Cubic-spline interpolation of X-Y-table values
  5495. Syntax          #include <VFstd.h>
  5496.                 void  VF_splineinterpol(
  5497.                              fVector Y,  fVector X,  ui sizex,
  5498.                              fVector XTab,  fVector YTab,
  5499.                              fVector Y2Tab,  ui sizetab );
  5500. Description     For each of the sizex elements of X, the corresponding element
  5501.                 of Y is interpolated from the XTab-YTab value pairs. A table
  5502.                 of second derivatives of YTab is needed that has to be
  5503.                 generated by a call to VF_splinederiv2 prior to calling
  5504.                 VF_splineinterpol.  XTab must be ordered (either ascending or
  5505.                 descending). All values of XTab must be distinct; otherwise a
  5506.                 division by zero may occur and lead to a program abort.
  5507.                 sizetab must be greater than or equal to 3.
  5508. Error handling  none (you have to take care yourself that the XTab values are
  5509.                 distinct and that the YTab values are not near the limit of
  5510.                 overflowing).
  5511. Return value    none
  5512. See also        VF_splinederiv2, VF_ratinterpol, VF_polyinterpol
  5513.  
  5514.  
  5515. ┌────────────────────────────────────────────────────────────────────────────┐
  5516. │ VF_square                VD_square                VE_square                │
  5517. │ VCF_square               VCD_square               VCE_square               │
  5518. │ VFx_square               VDx_square               VEx_square               │
  5519. │ VCFx_square              VCDx_square              VCEx_square              │
  5520. └────────────────────────────────────────────────────────────────────────────┘
  5521. Function        Square
  5522. Syntax          #include <VFmath.h>
  5523.                 int  VF_square(  fVector  Y,  fVector  X, ui size );
  5524.                 int  VFx_square( fVector  Y,  fVector  X, ui size,
  5525.                                  float A, float B );
  5526. Description     normal versions:    Yi = Xi²
  5527.                 expanded versions:  Yi = (A*Xi+B)²
  5528. Error handling  OVERFLOW errors lead to a default result of HUGE_VAL.
  5529. Return value    0, if no error occurred, otherwise non-zero
  5530. See also        VF_cubic,  VF_sqrt,  VF_pow,  VF_ipow,  VF_poly
  5531.  
  5532.  
  5533. ┌────────────────────────────────────────────────────────────────────────────┐
  5534. │ VF_sqrt                  VD_sqrt                  VE_sqrt                  │
  5535. │ VCF_sqrt                 VCD_sqrt                 VCE_sqrt                 │
  5536. │ VFx_sqrt                 VDx_sqrt                 VEx_sqrt                 │
  5537. │ VCFx_sqrt                VCDx_sqrt                VCEx_sqrt                │
  5538. └────────────────────────────────────────────────────────────────────────────┘
  5539. Function        Square root
  5540. Syntax          #include <VFmath.h>
  5541.                 int  VF_sqrt(  fVector Y,  fVector X, ui size );
  5542.                 int  VFx_sqrt( fVector Y,  fVector  X, ui size,
  5543.                                float A, float B, float C );
  5544. Description     normal versions:    Yi =  sqrt( Xi )
  5545.                 expanded versions:  Yi =  C * sqrt( A*Xi+B )
  5546. Error handling  DOMAIN errors occur if, in the real-number versions, the
  5547.                 square root of a negative numbers is requested; NAN ("not-a-
  5548.                 number") is the default result in this case.
  5549. Return value    0, if no error occurred, otherwise non-zero
  5550. See also        VF_square,  VF_sqrt,  VF_pow,  VF_ipow,  VF_poly
  5551.  
  5552.  
  5553. ┌────────────────────────────────────────────────────────────────────────────┐
  5554. │ VF_ssq                   VD_ssq                   VE_ssq                   │
  5555. └────────────────────────────────────────────────────────────────────────────┘
  5556. Function        Sum-of-squares
  5557. Syntax          #include <VFstd.h>
  5558.                 float  VF_ssq( fVector X, ui size );
  5559. Description     ssq  =  sum( Xi² )
  5560. Error handling  none (but be careful: this function may lead to an overflow!)
  5561. Return value    sum of the squares of the vector elements.
  5562. See also        VF_sum,  VF_rms,  VF_ssqdevC, VF_scalprod,  VF_Euclid
  5563.  
  5564.  
  5565. ┌────────────────────────────────────────────────────────────────────────────┐
  5566. │ VF_ssqdevC               VD_ssqdevC               VE_ssqdevC               │
  5567. └────────────────────────────────────────────────────────────────────────────┘
  5568. Function        Sum of the squares of the deviations from a preset value.
  5569. Syntax          #include <VFstd.h>
  5570.                 float  VF_ssqdevC( fVector X, ui size, float C );
  5571. Description     ssqdevC  =  sum( (Xi - C)² )
  5572. Error handling  none
  5573. Return value    sum of the squares of the deviations.
  5574. See also        VF_ssq, VF_ssqdevV, VF_avdevC,  VF_sumdevC, VF_chi2
  5575.  
  5576.  
  5577. ┌────────────────────────────────────────────────────────────────────────────┐
  5578. │ VF_ssqdevV               VD_ssqdevV               VE_ssqdevV               │
  5579. └────────────────────────────────────────────────────────────────────────────┘
  5580. Function        Sum of the squares of the deviations of the elements of one
  5581.                 vector from the corresponding elements of another
  5582. Syntax          #include <VFstd.h>
  5583.                 float  VF_ssqdevV( fVector X, fVector Y, ui size );
  5584. Description     ssqdevV  =  sum( (Xi - Yi)² )
  5585.                 The deviation of each element of X from the corresponding
  5586.                 element of Y is calculated and the squares of the deviations
  5587.                 summed up and returned.
  5588. Error handling  none
  5589. Return value    sum of the squares of the deviations.
  5590. See also        VF_ssq, VF_ssqdevC, VF_avdevV, VF_sumdevV, VF_chi2
  5591.  
  5592.  
  5593. ┌────────────────────────────────────────────────────────────────────────────┐
  5594. │ VF_store                 VD_store                 VE_store                 │
  5595. │ VCF_store                VCD_store                VCE_store                │
  5596. │ VI_store            VSI_store           VLI_store           VQI_store      │
  5597. │ VU_store            VUS_store           VUL_store           VUI_store      │
  5598. └────────────────────────────────────────────────────────────────────────────┘
  5599. Function        Store a vector in binary format into a stream
  5600. Syntax          #include <VFstd.h>
  5601.                 VF_store( FILE *stream,  fVector X,  ui size );
  5602. Description     size elements of X are written to stream in binary format.
  5603.                 The stream must be already open for binary write operations.
  5604. Error handling  none
  5605. Return value    none
  5606. See also        fwrite,  fread, VF_recall,  VF_write, VF_cprint, VF_print
  5607.  
  5608.  
  5609. ┌────────────────────────────────────────────────────────────────────────────┐
  5610. │ VF_subC                  VD_subC                  VE_subC                  │
  5611. │ VCF_subC                 VCD_subC                 VCE_subC                 │
  5612. │ VCF_subReC               VCD_subReC               VCE_subReC               │
  5613. │ VI_subC             VSI_subC            VLI_subC            VQI_subC       │
  5614. │ VU_subC             VUS_subC            VUL_subC            VUI_subC       │
  5615. └────────────────────────────────────────────────────────────────────────────┘
  5616. Function        Subtract a constant from each vector element
  5617. Syntax          #include <VFmath.h>
  5618.                 void  VF_subC( fVector Y, fVector X, ui size, float C );
  5619.                 void  VCF_subC(  cfVector Y,  cfVector X,  ui size,
  5620.                                  fComplex C );
  5621.                 void  VCF_subReC( cfVector Y,  cfVector X,  ui size,
  5622.                                   float CRe );
  5623. Description     Yi  =  Xi -  C
  5624.                 The complex floating-point versions exist in two variants, one
  5625.                 for complex constants C, the other for real-valued constants
  5626.                 CRe subtracted from the complex vector.
  5627. Error handling  floating-point versions: none;
  5628.                 integer versions: see chapter 5.2.
  5629. Return value    none
  5630. See also        VF_subV,   VF_subrC, VF_addC,  VF_mulC,  VF_divC
  5631.  
  5632.  
  5633. ┌────────────────────────────────────────────────────────────────────────────┐
  5634. │ VF_subrC                 VD_subrC                 VE_subrC                 │
  5635. │ VCF_subrC                VCD_subrC                VCE_subrC                │
  5636. │ VCF_subrReC              VCD_subrReC              VCE_subrReC              │
  5637. │ VI_subrC            VSI_subrC           VLI_subrC           VQI_subrC      │
  5638. │ VU_subrC            VUS_subrC           VUL_subrC           VUI_subrC      │
  5639. └────────────────────────────────────────────────────────────────────────────┘
  5640. Function        Reverse subtraction: subtract a vector from a constant
  5641. Syntax          #include <VFmath.h>
  5642.                 void  VF_subrC(  fVector Y,  fVector X,  ui size, float C );
  5643.                 void  VCF_subrC( cfVector Y,  cfVector X,  ui size,
  5644.                                  fComplex C );
  5645.                 void  VCF_subrReC( cfVector Y,  cfVector X,  ui size,
  5646.                                    float CRe );
  5647. Description     Yi  =  C  -  Xi
  5648.                 The complex floating-point versions exist in two variants, one
  5649.                 for complex constants C, the other for real-valued constants
  5650.                 CRe from which the complex vector is subtracted.
  5651. Error handling  floating-point versions: none;
  5652.                 integer versions: see chapter 5.2.
  5653. Return value    none
  5654. See also        VF_addV,  VF_subC,  VF_mulC,  VF_divC,  VF_visC,  VF_redC
  5655.  
  5656.  
  5657. ┌────────────────────────────────────────────────────────────────────────────┐
  5658. │ VF_subrV                 VD_subrV                 VE_subrV                 │
  5659. │ VCF_subrV                VCD_subrV                VCE_subrV                │
  5660. │ VCF_subrReV              VCD_subrReV              VCE_subrReV              │
  5661. │ VFx_subrV                VDx_subrV                VEx_subrV                │
  5662. │ VCFx_subrV               VCDx_subrV               VCEx_subrV               │
  5663. │ VCFx_subrReV             VCDx_subrReV             VCEx_subrReV             │
  5664. │ VI_subrV            VSI_subrV           VLI_subrV           VQI_subrV      │
  5665. │ VU_subrV            VUS_subrV           VUL_subrV           VUI_subrV      │
  5666. └────────────────────────────────────────────────────────────────────────────┘
  5667. Function        Subtraction in reverse order
  5668. Syntax          #include <VFmath.h>
  5669.                 void  VF_subrV( fVector Z, fVector X, fVector Y, ui size );
  5670.                 void  VFx_subrV( fVector Z, fVector X,  fVector Y,
  5671.                                  ui size, float A,  float  B );
  5672.                 void  VCF_subrV(  cfVector Z, cfVector X, cfVector Y,
  5673.                                   ui size );
  5674.                 void  VCF_subrReV( cfVector Z, cfVector X, fVector Y,
  5675.                                    ui size );
  5676.                 void  VCFx_subrV( cfVector Z, cfVector X, cfVector Y,
  5677.                                   ui size, fComplex A,  fComplex B );
  5678.                 void  VCFx_subrReV( cfVector Z, cfVector X, fVector Y,
  5679.                                     ui size, fComplex A,  fComplex B );
  5680. Description     normal versions:    Zi  =  Yi  -  Xi
  5681.                 expanded versions:  Zi  =  Yi  -  (A*Xi+B)
  5682.                 The complex floating-point versions exist in two variants: in
  5683.                 the first variant (e.g., VCF_subrV,  VCFx_subrV), X, Y, and Z
  5684.                 are all complex; in the second variant, Y is real-valued
  5685.                 (e.g., VCF_subrReV - "reverse subtraction of a real vector",
  5686.                 i.e., subtraction of a complex vector from a real vector).
  5687. Error handling  floating-point versions: none;
  5688.                 integer versions: see chapter 5.2.
  5689. Return value    none
  5690. See also        VF_subrC,  VF_addV,  VF_mulV,  VF_divV,  VF_visV,  VF_redV
  5691.  
  5692.  
  5693. ┌────────────────────────────────────────────────────────────────────────────┐
  5694. │ VF_subV                  VD_subV                  VE_subV                  │
  5695. │ VCF_subV                 VCD_subV                 VCE_subV                 │
  5696. │ VCF_subReV               VCD_subReV               VCE_subReV               │
  5697. │ VFs_subV                 VDs_subV                 VEs_subV                 │
  5698. │ VFx_subV                 VDx_subV                 VEx_subV                 │
  5699. │ VCFx_subV                VCDx_subV                VCEx_subV                │
  5700. │ VCFx_subReV              VCDx_subReV              VCEx_subReV              │
  5701. │ VI_subV             VSI_subV            VLI_subV            VQI_subV       │
  5702. │ VU_subV             VUS_subV            VUL_subV            VUI_subV       │
  5703. └────────────────────────────────────────────────────────────────────────────┘
  5704. Function        Subtract two vectors
  5705. Syntax          #include <VFmath.h>
  5706.                 void  VF_subV( fVector Z, fVector X, fVector Y, ui size );
  5707.                 void  VFs_subV( fVector Z, fVector X, fVector Y, ui size,
  5708.                                 float C );
  5709.                 void  VFx_subV( fVector Z, fVector X, fVector Y, ui size,
  5710.                                 float A,  float  B );
  5711.                 void  VCF_subV( cfVector Z, cfVector X, cfVector Y, ui size );
  5712.                 void  VCF_subReV( cfVector Z, cfVector X, fVector Y,
  5713.                                   ui size );
  5714.                 void  VCFx_subV( cfVector Z, cfVector X, cfVector Y,
  5715.                                  ui size,  fComplex A,  fComplex B );
  5716.                 void  VCFx_subReV( cfVector Z, cfVector X, fVector Y,
  5717.                                    ui size,  fComplex A,  fComplex B );
  5718. Description     normal versions:      Zi  =  Xi - Yi
  5719.                 scaled versions:      Zi  =  C * (Xi - Yi)
  5720.                 expanded versions:    Zi  =  (A*Xi+B) - Yi
  5721.                 The complex floating-point versions exist in two variants: in
  5722.                 the first variant (e.g., VCF_subV,  VCFx_subV), X, Y, and Z
  5723.                 are all complex; in the second variant, Y is real-valued
  5724.                 (e.g., VCF_subReV - "subtract a real vector").
  5725. Error handling  floating-point versions: none;
  5726.                 integer versions: see chapter 5.2.
  5727. Return value    none
  5728. See also        VF_subC,  VF_addV,  VF_mulV,  VF_divV,  VF_visV,  VF_redV
  5729.  
  5730.  
  5731. ┌────────────────────────────────────────────────────────────────────────────┐
  5732. │ VF_subvector             VD_subvector             VE_subvector             │
  5733. │ VCF_subvector            VCD_subvector            VCE_subvector            │
  5734. │ VI_subvector        VSI_subvector       VLI_subvector       VQI_subvector  │
  5735. │ VU_subvector        VUS_subvector       VUL_subvector       VUI_subvector  │
  5736. └────────────────────────────────────────────────────────────────────────────┘
  5737. Function        Extract a sub-vector from the input vector
  5738. Syntax          #include <VFstd.h>
  5739.                 void  VF_subvector( fVector Y,  ui subsize,
  5740.                                     fVector X,  int samp );
  5741. Description     Y[i]  =  X[i*samp]
  5742.                 A sub-vector Y is extracted from X with a sampling interval
  5743.                 samp. This means that every samp'th element is taken, up to
  5744.                 a total of subsize elements, starting with the zeroth element
  5745.                 of X. Since X may be an expression like XX+1000, samp does
  5746.                 not always need to be positive, but may also take on negative
  5747.                 values (or the trivial value of 0).  X and Y have to be
  5748.                 distinct. Instead of using a samp of 0, 1, or -1, one should
  5749.                 use VF_equC, VF_equV,  or VF_rev,  respectively.
  5750. Error handling  none
  5751. Return value    none
  5752. See also        VF_indpick, VF_CtoRe
  5753.  
  5754.  
  5755. ┌────────────────────────────────────────────────────────────────────────────┐
  5756. │ VF_subvector_...         VD_subvector_...         VE_subvector_...         │
  5757. │ VCF_subvector_...        VCD_subvector_...        VCE_subvector_...        │
  5758. │               ..._addC                 ..._addV                            │
  5759. │               ..._divC                 ..._divV                            │
  5760. │               ..._divrC                ..._divrV                           │
  5761. │               ..._mulC                 ..._mulV                            │
  5762. │               ..._subC                 ..._subV                            │
  5763. │               ..._subrC                ..._subrV                           │
  5764. └────────────────────────────────────────────────────────────────────────────┘
  5765. Function        Arithmetic functions working on a sub-set of elements within
  5766.                 a vector of one of the floating-point data types.
  5767. Syntax          #include <VFmath.h>
  5768.                 void  VF_subvector_addC( fVector Y, ui subsize,
  5769.                                          unsigned samp, float C );
  5770.                 void VF_subvector_addV( fVector Y, ui subsize,
  5771.                                         unsigned samp, fVector X );
  5772.                      (similarly all other functions of this family)
  5773. Description     ..._addC:    Y[i*samp]  +=  C,              i=0,...subsize-1
  5774.                 ..._addV:    Y[i*samp]  +=  Xi,             i=0,...subsize-1
  5775.                 ..._subC:    Y[i*samp]  -=  C,              i=0,...subsize-1
  5776.                 ..._subV:    Y[i*samp]  -=  Xi,             i=0,...subsize-1
  5777.                 ..._subrC:   Y[i*samp]   =  C - Y[i*samp],  i=0,...subsize-1
  5778.                 ..._subrV:   Y[i*samp]   =  Xi- Y[i*samp],  i=0,...subsize-1
  5779.                 ..._mulC:    Y[i*samp]  *=  C,              i=0,...subsize-1
  5780.                 ..._mulV:    Y[i*samp]  *=  Xi,             i=0,...subsize-1
  5781.                 ..._divC:    Y[i*samp]  /=  C,              i=0,...subsize-1
  5782.                 ..._divV:    Y[i*samp]  /=  Xi,             i=0,...subsize-1
  5783.                 ..._divrC:   Y[i*samp]   =  C  / Y[i*samp], i=0,...subsize-1
  5784.                 ..._divrV:   Y[i*samp]   =  Xi / Y[i*samp], i=0,...subsize-1
  5785.                 The operation indicated in the suffix of the function name is
  5786.                 perfomed on a sub-set of the elements of a vector. The
  5787.                 sampling interval is denoted by samp: every samp'th element is
  5788.                 taken, up to a total of subsize, starting with the zeroth one
  5789.                 (that means, subsize is not the total size of the vector, but
  5790.                 rather the size of the sub-set, i.e. the number of elements
  5791.                 for which the function is performed).  Notice that all
  5792.                 operations are performed in place, i.e., the input vector
  5793.                 itself is changed.
  5794.                 For similar functions not included in the above list, the
  5795.                 necessary sequence of calls is similar to the following
  5796.                 example (which shows how to calculate the sinc function of the
  5797.                 zeroth and then every tenth element of X, assuming that size
  5798.                 is an integer multiple of 10):
  5799.                      VF_subvector( Y, size/10, 10, X );
  5800.                      VF_sinc( Y, Y, size/10 );
  5801.                      VF_subvector_equV( X, size/10, 10, Y );
  5802.                 (However, in such cases, you would sometimes prefer the
  5803.                 classic style of a loop with the loop-increment set to 10.
  5804.                 Only if the desired function is not available in the math
  5805.                 library of Borland C, the effort of copying back and forth
  5806.                 into the dummy vector Y will pay off.)
  5807. Error handling  none
  5808. Return value    none
  5809. See also        VF_subvector,  VF_subvector_equC,  VF_subvector_equV,  VF_addC
  5810.  
  5811.  
  5812. ┌────────────────────────────────────────────────────────────────────────────┐
  5813. │ VF_subvector_...         VD_subvector_...         VE_subvector_...         │
  5814. │ VCF_subvector_...        VCD_subvector_...        VCE_subvector_...        │
  5815. │ VI_subvector_...         VSI_subvector_...                                 │
  5816. │ VLI_subvector_...        VQI_subvector_...                                 │
  5817. │ VU_subvector_...         VUS_subvector_...                                 │
  5818. │ VUL_subvector_...        VUI_subvector_...                                 │
  5819. │               ..._equC                 ..._equV                            │
  5820. └────────────────────────────────────────────────────────────────────────────┘
  5821. Function        Initialize a sub-set of elements within a vector either with a
  5822.                 constant value or with values stored as the elements of
  5823.                 another vector.
  5824. Syntax          #include <VFstd.h>
  5825.                 void  VF_subvector_equC( fVector Y, ui subsize,
  5826.                                          unsigned samp, float C );
  5827.                 void  VF_subvector_equV( fVector Y,  ui subsize,
  5828.                                          unsigned samp, fVector X );
  5829.                      (similarly all other functions of this family)
  5830. Description     ..._equC:  Y[i*samp]  =  C,         i=0,...subsize-1
  5831.                 ..._equV:  Y[i*samp]  =  Xi,        i=0,...subsize-1
  5832.                 A sub-set of the elements of a vector is overwritten according
  5833.                 to the sampling interval samp: every samp'th element is
  5834.                 initialized either with the constant C, or with the value
  5835.                 specified as an element of the vector X. A total of subsize
  5836.                 elements is initialized, starting with the zeroth one (that
  5837.                 means, subsize is not the total size of the vector, but rather
  5838.                 the size of the sub-set). VF_subvector_equV is the exact
  5839.                 reverse of VF_subvector.
  5840. Error handling  none
  5841. Return value    none
  5842. See also        VF_subvector,  VF_equC,  VF_equV,  VF_subvector_addC
  5843.  
  5844.  
  5845. ┌────────────────────────────────────────────────────────────────────────────┐
  5846. │ VF_sum                   VD_sum                   VE_sum                   │
  5847. │ VCF_sum                  VCD_sum                  VCE_sum                  │
  5848. │ VI_sum            VSI_sum             VLI_sum             VQI_sum          │
  5849. │ VU_sum            VUS_sum             VUL_sum             VUI_sum          │
  5850. └────────────────────────────────────────────────────────────────────────────┘
  5851. Function        Sum up all the elements of a vector.
  5852. Syntax          #include <VFstd.h>
  5853.                 float  VF_sum(  fVector  X, ui size );
  5854. Description     sum  =  sum( Xi )
  5855.                 The sum over all elements of a vector is calculated and
  5856.                 returned.
  5857. Error handling  none (but be careful: this function may easily overflow!)
  5858. Return value    sum of the vector elements.
  5859. See also        VF_runsum, VF_prod, VF_ssq, VF_ssqdevC, VF_mean
  5860.  
  5861.  
  5862. ┌────────────────────────────────────────────────────────────────────────────┐
  5863. │ VF_sumabs                VD_sumabs                VE_sumabs                │
  5864. └────────────────────────────────────────────────────────────────────────────┘
  5865. Function        Sum up the absolute values of all the elements of a vector.
  5866. Syntax          #include <VFstd.h>
  5867.                 float  VF_sumabs(  fVector  X, ui size );
  5868. Description     sumabs  =  sum(| Xi |)
  5869. Error handling  none (but be careful: this function may easily overflow!)
  5870. Return value    sum of the absolute values of all vector elements.
  5871. See also        VF_sum, VF_meanabs
  5872.  
  5873.  
  5874. ┌────────────────────────────────────────────────────────────────────────────┐
  5875. │ VF_sumdevC               VD_sumdevC               VE_sumdevC               │
  5876. └────────────────────────────────────────────────────────────────────────────┘
  5877. Function        Sum of the absolute deviations from a preset value.
  5878. Syntax          #include <VFstd.h>
  5879.                 float  VF_sumdevC( fVector X, ui size, float C );
  5880. Description     sumdevC  =  sum( |Xi - C| )
  5881. Error handling  none
  5882. Return value    sum of the absolute deviations.
  5883. See also        VF_ssqdevC, VF_sumdevV, VF_avdevC
  5884.  
  5885.  
  5886. ┌────────────────────────────────────────────────────────────────────────────┐
  5887. │ VF_sumdevV               VD_sumdevV               VE_sumdevV               │
  5888. └────────────────────────────────────────────────────────────────────────────┘
  5889. Function        Sum of the absolute deviations of the elements of one
  5890.                 vector from the corresponding elements of another
  5891. Syntax          #include <VFstd.h>
  5892.                 float  VF_sumdevV( fVector X, fVector Y, ui size );
  5893. Description     sumdevV  =  sum( |Xi - Yi| )
  5894. Error handling  none
  5895. Return value    sum of the absolute deviations.
  5896. See also        VF_sum, VF_sumdevC, VF_avdevV, VF_ssqdevV
  5897.  
  5898.  
  5899. ┌────────────────────────────────────────────────────────────────────────────┐
  5900. │ VF_tan                   VD_tan                   VE_tan                   │
  5901. │ VCF_tan                  VCD_tan                  VCE_tan                  │
  5902. │ VFx_tan                  VDx_tan                  VEx_tan                  │
  5903. │ VCFx_tan                 VCDx_tan                 VCEx_tan                 │
  5904. └────────────────────────────────────────────────────────────────────────────┘
  5905. Function        Tangent function
  5906. Syntax          #include <VFmath.h>
  5907.                 int  VF_tan(  fVector  Y,  fVector  X, ui size );
  5908.                 int  VFx_tan( fVector  Y, fVector  X, ui size,
  5909.                              float A, float B, float C );
  5910. Description     normal versions:     Yi  =  tan ( Xi )
  5911.                 expanded versions:   Yi  =  C *  tan( A*Xi+B )
  5912.                 For large values of Xi, round-off error becomes appreciable;
  5913.                 if the Xi values are representable as rational multiples of Pi,
  5914.                 it is better to use VF_tanrpi  than VF_tan.
  5915. Error handling  SING and OVERFLOW errors (for arguments very close to Pi/2)
  5916.                 lead to a default result of ±HUGE_VAL. Precision errors lead
  5917.                 to a default result of 0.0.
  5918. Return value    0, if no error occurred, otherwise non-zero.
  5919. See also        VF_tan2,  VF_tanrpi,  VF_sin,  VF_tanh,  VF_atan,  VF_atan2
  5920.  
  5921.  
  5922. ┌────────────────────────────────────────────────────────────────────────────┐
  5923. │ VF_tan2                  VD_tan2                  VE_tan2                  │
  5924. │ VFx_tan2                 VDx_tan2                 VEx_tan2                 │
  5925. └────────────────────────────────────────────────────────────────────────────┘
  5926. Function        Square of the tangent function
  5927. Syntax          #include <VFmath.h>
  5928.                 int  VF_tan2(  fVector  Y,  fVector  X, ui size );
  5929.                 int  VFx_tan2( fVector  Y,  fVector  X, ui size,
  5930.                                float A, float B, float C );
  5931. Description     normal versions:    Yi  =  tan²( Xi )
  5932.                 expanded versions:  Yi  =  C * tan²( A*Xi+B )
  5933.                 Calculating the squared trigonometric functions directly is
  5934.                 faster and sometimes more accurate than first calculating the
  5935.                 trigonometric function itself and squaring it afterwards.
  5936. Error handling  SING and OVERFLOW errors (for arguments close to Pi/2) lead
  5937.                 to a default result of ±HUGE_VAL. Precision errors lead to a
  5938.                 default result of 0.0.
  5939. Return value    0, if no error occurred, otherwise non-zero.
  5940. See also        VF_tan,   VF_tanrpi,   sin
  5941.  
  5942.  
  5943. ┌────────────────────────────────────────────────────────────────────────────┐
  5944. │ VF_tanh                  VD_tanh                  VE_tanh                  │
  5945. │ VCF_tanh                 VCD_tanh                 VCE_tanh                 │
  5946. │ VFx_tanh                 VDx_tanh                 VEx_tanh                 │
  5947. │ VCFx_tanh                VCDx_tanh                VCEx_tanh                │
  5948. └────────────────────────────────────────────────────────────────────────────┘
  5949. Function        Hyperbolic tangent function
  5950. Syntax          #include <VFmath.h>
  5951.                 int  VF_tanh(  fVector  Y,  fVector  X, ui size );
  5952.                 int  VFx_tanh( fVector  Y,  fVector  X, ui size,
  5953.                                float A, float B, float C );
  5954. Description     normal versions:   Yi = tanh( Xi )
  5955.  
  5956.                                          exp( Xi ) - exp( -Xi )
  5957.                                       =  ──────────────────────
  5958.                                          exp( Xi ) + exp( -Xi )
  5959.  
  5960.                 expanded versions: Yi = C * tanh( A*Xi+B )
  5961. Error handling  These functions should be error-proof.
  5962. Return value    always 0.
  5963. See also        VF_sinh,  VF_exp,   tanh
  5964.  
  5965.  
  5966. ┌────────────────────────────────────────────────────────────────────────────┐
  5967. │ VF_tanrpi                VD_tanrpi                VE_tanrpi                │
  5968. │ VF_tanrpi2               VD_tanrpi2               VE_tanrpi2               │
  5969. │ VF_tanrpi3               VD_tanrpi3               VE_tanrpi3               │
  5970. └────────────────────────────────────────────────────────────────────────────┘
  5971. Function        Tangent function of fractional multiples of Pi
  5972. Syntax          #include <VFmath.h>
  5973.                 int  VF_tanrpi(  fVector Y, iVector P, ui size, int q );
  5974.                 int  VF_tanrpi2( fVector Y, iVector P, ui size, int q );
  5975.                 int  VF_tanrpi3( fVector Y, iVector P, ui size, int q );
  5976. Description     Yi  =  tan( (P[i] / q) * Pi )
  5977.                 The tangent of fractional multiples of Pi is calculated. There
  5978.                 are three versions: VF_tanrpi is for general use with any
  5979.                 arbitrary denominator q. If q is a power of 2,  VF_tanrpi2
  5980.                 should be used which is a highly optimized version using a
  5981.                 look-up table. If q is a multiple of 3,  VF_tanrpi3 should be
  5982.                 used. VF_tanrpi2 and VF_tanrpi3 work also with q values they
  5983.                 are not optimized for; in this case, however, memory space is
  5984.                 wasted for the then useless tables.
  5985. Error handling  SING errors occur if P[i] / q  is an odd multiple of 1/2; the
  5986.                 default result is 0.0 (which is the mean of +HUGE_VAL and
  5987.                 -HUGE_VAL).
  5988.                 q must be non-zero; this is, however, not tested for.
  5989. Return value    0, if no error occurred, otherwise non-zero.
  5990. See also        VF_tan,   tan
  5991.  
  5992.  
  5993. ┌────────────────────────────────────────────────────────────────────────────┐
  5994. │ VF_tantab2               VD_tantab2               VE_tantab2               │
  5995. │ VF_tantab3               VD_tantab3               VE_tantab3               │
  5996. └────────────────────────────────────────────────────────────────────────────┘
  5997.                 Table of tangent values for arguments between 0 and Pi/2.
  5998. Syntax          #include <xmath.h>
  5999.                 extern float     VF_tantab2[ VF_tabsz2+1 ];
  6000.                 extern double    VD_tantab2[ VD_tabsz2+1 ];
  6001.                 extern extended  VE_tantab2[ VE_tabsz2+1 ];
  6002.                 extern float     VF_tantab3[ VF_tabsz3+1 ];
  6003.                 extern double    VD_tantab3[ VD_tabsz3+1 ];
  6004.                 extern extended  VE_tantab3[ VE_tabsz3+1 ];
  6005. Description     VF_tantab2[ i ]  =  tan( i/(2*VF_tabsz2) * Pi ),
  6006.                                                       i=0,...,VF_tabsz2-1
  6007.                 VF_tantab3[ i ]  =  tan( i/(2*VF_tabsz3) * Pi ),
  6008.                                                       i=0,...,VF_tabsz3-1
  6009.                 VF_tantab2[ VF_tabsz2 ]  =  VF_tantab3[ VF_tabsz3 ] = 0;
  6010.  
  6011.                 These look-up tables of tangent values for arguments between 0
  6012.                 and Pi/2 are used by VF_tanrpi2 and the other functions of
  6013.                 that family and are also available for other purposes. Since
  6014.                 the tangent of Pi/2 is not defined, zero is stored at its
  6015.                 place. The symbols VF_tabsz2 etc., denoting the size of the
  6016.                 tables, are defined in <xmath.h>.
  6017. See also        VF_tanrpi2,  VF_sintab2,  VF_cosectab2
  6018.  
  6019.  
  6020. ┌────────────────────────────────────────────────────────────────────────────┐
  6021. │ VF_trunc                 VD_trunc                 VE_trunc                 │
  6022. │ VF_trunctoI              VD_trunctoI              VE_trunctoI              │
  6023. │ VF_trunctoSI             VD_trunctoSI             VE_trunctoSI             │
  6024. │ VF_trunctoLI             VD_trunctoLI             VE_trunctoLI             │
  6025. │ VF_trunctoQI             VD_trunctoQI             VE_trunctoQI             │
  6026. │ VF_trunctoU              VD_trunctoU              VE_trunctoU              │
  6027. │ VF_trunctoUS             VD_trunctoUS             VE_trunctoUS             │
  6028. │ VF_trunctoUL             VD_trunctoUL             VE_trunctoUL             │
  6029. │ VF_trunctoUI             VD_trunctoUI             VE_trunctoUI             │
  6030. └────────────────────────────────────────────────────────────────────────────┘
  6031. Function        Rounding by "truncating" toward zero.
  6032. Syntax          #include <VFmath.h>
  6033.                 int VF_trunc(     fVector Y,  fVector X,  ui size );
  6034.                 int VF_trunctoI(  iVector Y,  fVector X,  ui size );
  6035.                 int VF_trunctoU(  uVector Y,  fVector X,  ui size );
  6036.                      (similarly  all other functions of this family)
  6037. Description     These functions are identical to those of the VF_chop family.
  6038.                 They have been defined in order to maintain consistency with
  6039.                 the function name trunc defined in Turbo Pascal. For details,
  6040.                 see VF_chop.
  6041.  
  6042.  
  6043. ┌────────────────────────────────────────────────────────────────────────────┐
  6044. │ V_UtoF                   V_UtoD                   V_UtoE                   │
  6045. │ V_UItoF                  V_UItoD                  V_UItoE                  │
  6046. │ V_ULtoF                  V_ULtoD                  V_ULtoE                  │
  6047. │ V_UStoF                  V_UStoD                  V_UStoE                  │
  6048. └────────────────────────────────────────────────────────────────────────────┘
  6049. Function        Data type interconversions.  See V_ItoF!
  6050.  
  6051.  
  6052. ┌────────────────────────────────────────────────────────────────────────────┐
  6053. │ VF_varianceC             VD_varianceC             VE_varianceC             │
  6054. └────────────────────────────────────────────────────────────────────────────┘
  6055. Function        Variance of a one-dimensional distribution with respect to a
  6056.                 pre-set value
  6057. Syntax          #include <VFstd.h>
  6058.                 float  VF_varianceC( fVector X, ui size, float C );
  6059. Description     var  = (1 / size) * sum( (Xi - C)² )
  6060. Error handling  none
  6061. Return value    The variance is returned.
  6062. See also        VF_mean, VF_varianceV, VF_ssq, VF_ssqdevC, VF_linregress
  6063.  
  6064.  
  6065. ┌────────────────────────────────────────────────────────────────────────────┐
  6066. │ VF_varianceCwW           VD_varianceCwW           VE_varianceCwW           │
  6067. └────────────────────────────────────────────────────────────────────────────┘
  6068. Function        "Variance with weights" of a one-dimensional distribution with
  6069.                 respect to a pre-set value.
  6070. Syntax          #include <VFstd.h>
  6071.                 float  VF_varianceCwW( fVector X, fVector Wt, ui size,
  6072.                                        float C );
  6073. Description     var  =  (1 / sum( Wti )) * sum(  Wti * (Xi - C)² )
  6074.                 The weights need not be normalized.
  6075. Error handling  none
  6076. Return value    variance of the distribution.
  6077. See also        VF_meanwW, VF_varianceC, VF_varianceVwW, VF_linregress
  6078.  
  6079.  
  6080. ┌────────────────────────────────────────────────────────────────────────────┐
  6081. │ VF_varianceV             VD_varianceV             VE_varianceV             │
  6082. └────────────────────────────────────────────────────────────────────────────┘
  6083. Function        Variance between two one-dimensional distributions.
  6084. Syntax          #include <VFstd.h>
  6085.                 float  VF_varianceV( fVector X, fVector Y, ui size );
  6086. Description     var  = (1 / size) * sum( (Xi - Yi)² )
  6087. Error handling  none
  6088. Return value    The variance is returned.
  6089. See also        VF_mean, VF_varianceC,  VF_ssq, VF_ssqdevV, VF_linregress
  6090.  
  6091.  
  6092. ┌────────────────────────────────────────────────────────────────────────────┐
  6093. │ VF_varianceVwW           VD_varianceVwW           VE_varianceVwW           │
  6094. └────────────────────────────────────────────────────────────────────────────┘
  6095. Function        "Variance with weights" between two one-dimensional
  6096.                 distributions.
  6097. Syntax          #include <VFstd.h>
  6098.                 float  VF_varianceVwW( fVector X, fVector Y,
  6099.                                        fVector Wt, ui size );
  6100. Description     var  = (1 / sum( Wti )) * sum( Wti * (Xi - Yi)² )
  6101.                 The weights need not be normalized.
  6102. Error handling  none
  6103. Return value    weighted variance
  6104. See also        VF_meanwW,  VF_chi2, VF_varianceV, VF_varianceCwW,
  6105.                 VF_linregress
  6106.  
  6107.  
  6108. ┌────────────────────────────────────────────────────────────────────────────┐
  6109. │ VF_vector                VD_vector                VE_vector                │
  6110. │ VCF_vector               VCD_vector               VCE_vector               │
  6111. │ VI_vector         VSI_vector          VLI_vector          VQI_vector       │
  6112. │ VU_vector         VUS_vector          VUL_vector          VUI_vector       │
  6113. └────────────────────────────────────────────────────────────────────────────┘
  6114. Function        Memory allocation for a vector
  6115. Syntax          #include <VFstd.h>
  6116.                 fVector   VF_vector(  ui size );
  6117. Description     Based on memory model and environment, the most appropriate
  6118.                 allocation procedure is chosen by these functions. Failure to
  6119.                 allocate memory always leads to an error message and a
  6120.                 subsequent program abort (similar to the error handling of the
  6121.                 "new" operator in C++). To release the memory thus allocated,
  6122.                 V_free or V_nfree should be used. Notice: the declaration of a
  6123.                 vector (e.g., as fVector) reserves only a name, but no memory!
  6124.                 See chapter 4.1 if you are interested in details of the
  6125.                 implementation.
  6126. Error handling  If there is not enough memory available, or if size is zero,
  6127.                 an error message "Not enough memory" is displayed and the
  6128.                 program aborted.
  6129.                 Models SMALL, MEDIUM, COMPACT, and LARGE only:
  6130.                   If more than 64 kB of memory are requested,
  6131.                   an error message "Vector > 64 kB not possible" is displayed
  6132.                   and the program aborted.
  6133. Return value    Pointer to the allocated memory
  6134. See also        malloc, calloc
  6135.  
  6136.  
  6137. ┌────────────────────────────────────────────────────────────────────────────┐
  6138. │ VF_vector0               VD_vector0               VE_vector0               │
  6139. │ VCF_vector0              VCD_vector0              VCE_vector0              │
  6140. │ VI_vector0        VSI_vector0         VLI_vector0         VQI_vector0      │
  6141. │ VU_vector0        VUS_vector0         VUL_vector0         VUI_vector0      │
  6142. └────────────────────────────────────────────────────────────────────────────┘
  6143. Function        Memory allocation for a vector and initialization of all
  6144.                 elements with 0
  6145. Syntax          #include <VFstd.h>
  6146.                 fVector   VF_vector0(  ui size );
  6147. Description     The functions of this family are almost identical to those of
  6148.                 the VF_vector family; in addition to allocating memory, they
  6149.                 initialize all elements with 0. (Calls to VF_vector and
  6150.                 VF_vector0  may be mixed; they use the same tables to keep
  6151.                 track of the handles and pointers).  For further information,
  6152.                 see VF_vector.
  6153. Error handling  If there is not enough memory available, or if size is zero,
  6154.                 an error message "Not enough memory" is displayed and the
  6155.                 program aborted.
  6156.                 Models SMALL, MEDIUM, COMPACT, and LARGE only:
  6157.                   If more than 64 kB of memory are requested,
  6158.                   an error message "Vector > 64 kB not possible" is displayed
  6159.                   and the program aborted.
  6160. Return value    A pointer to the allocated memory is returned.
  6161. See also        malloc, calloc
  6162.  
  6163.  
  6164. ┌────────────────────────────────────────────────────────────────────────────┐
  6165. │ VF_visC                  VD_visC                  VE_visC                  │
  6166. └────────────────────────────────────────────────────────────────────────────┘
  6167. Function        Visibility (or contrast) function of a vector with respect to
  6168.                 a constant
  6169. Syntax          #include <VFmath.h>
  6170.                 void  VF_visC( fVector Y, fVector X, ui size, float C );
  6171. Description     Yi  =  vis( Xi, C )  =  (Xi - C) / (Xi + C)
  6172.                 These functions are generalizations of the "visibility" or
  6173.                 "contrast" function used in optics, where the contrast between
  6174.                 two intensities is defined as their difference divided by
  6175.                 their sum.
  6176.                 For Xi=C, the visibility is defined as 0, even in the case
  6177.                 of Xi=C=0.
  6178. Error handling  none
  6179. Return value    none
  6180. See also        VF_redV,  VF_addC,  VF_subC,  VF_divC,  VF_visC
  6181.  
  6182.  
  6183. ┌────────────────────────────────────────────────────────────────────────────┐
  6184. │ VF_visV                  VD_visV                  VE_visV                  │
  6185. │ VFx_visV                 VDx_visV                 VEx_visV                 │
  6186. └────────────────────────────────────────────────────────────────────────────┘
  6187. Function        Visibility function of one vector with respect to another
  6188. Syntax          #include <VFmath.h>
  6189.                 void  VF_visV( fVector Z,   fVector X,  fVector Y, ui size );
  6190.                 void  VFx_visV( fVector Z,   fVector X,  fVector Y,
  6191.                                 ui size,  float  A,  float  B );
  6192. Description     normal versions:   Zi  =  vis( Xi, Yi )
  6193.                                        =  (Xi - Yi) / (Xi + Yi)
  6194.                 expanded versions: Zi  =  vis( A*Xi+B, Yi )
  6195.                 For Xi=Yi, the visibility is defined as 0, even in the case
  6196.                 of Xi=Yi=0.
  6197. Error handling  none
  6198. Return value    none
  6199. See also        VF_visC,  VF_addV,  VF_subV,  VF_divV,  VF_redV
  6200.  
  6201.  
  6202. ┌────────────────────────────────────────────────────────────────────────────┐
  6203. │ VF_Welch                 VD_Welch                 VE_Welch                 │
  6204. └────────────────────────────────────────────────────────────────────────────┘
  6205. Function        "Welch" window for use in spectral analysis
  6206. Syntax          #include <VFstd.h>
  6207.                 void VF_Welch(  fVector X, ui size );
  6208. Description     Xi  = 1 - ( (i - 0.5*(size - 1)) / (0.5*(size + 1)) )²
  6209. Error handling  none
  6210. Return value    none
  6211. See also        VF_Parzen, VF_Hanning, VF_spectrum
  6212.  
  6213.  
  6214. ┌────────────────────────────────────────────────────────────────────────────┐
  6215. │ VF_write                 VD_write                 VE_write                 │
  6216. │ VCF_write                VCD_write                VCE_write                │
  6217. │ VI_write          VSI_write           VLI_write           VQI_write        │
  6218. │ VU_write          VUS_write           VUL_write           VUI_write        │
  6219. └────────────────────────────────────────────────────────────────────────────┘
  6220. Function        Write a vector in ASCII format to a stream.
  6221. Syntax          #include <VFstd.h>
  6222.                 void VF_write(  FILE *stream, fVector X, ui size );
  6223. Description     size elements of X are written to stream in ASCII format.
  6224.                 By default, one element is written per line. To use these
  6225.                 functions, stream must already be open for write operations
  6226.                 in text format.
  6227.  
  6228.                 The number format and the separation of consecutive elements
  6229.                 may be specified using VF_setWriteFormat and
  6230.                 VF_setWriteSeparate, respectively. See these functions
  6231.                 for details.
  6232.  
  6233.                 Storing data in ASCII format is useful if the data have to be
  6234.                 readable by human eyes, or if they are to be exported into
  6235.                 other programs which are not able to read machine-format
  6236.                 numbers. If avoidable, these functions should not be used for
  6237.                 the storage of intermediate results that later have again to
  6238.                 be read in. Instead, the function pairs of the VF_store /
  6239.                 VF_recall  family are recommended for the following reasons:
  6240.                 conversion into ASCII format is slow, may lead to round-off
  6241.                 errors, and requires much more disk memory than storage in
  6242.                 machine format.
  6243. Error handling  none
  6244. Return value    none
  6245. See also        VF_setWriteFormat, VF_setWriteSeparate, VF_nwrite, VF_read,
  6246.                 VF_store, fprintf, VF_cprint, VF_print
  6247.  
  6248.  
  6249. ┌────────────────────────────────────────────────────────────────────────────┐
  6250. │ VF_xcorr                 VD_xcorr                 VE_xcorr                 │
  6251. └────────────────────────────────────────────────────────────────────────────┘
  6252. Function        Cross-correlation function of two vectors.
  6253. Syntax          #include <VFstd.h>
  6254.                 void VF_xcorr(  fVector Z, fVector X, fVector Y, ui size );
  6255. Description     The cross-correlation function (CCF) of X and Y is calculated
  6256.                 and stored in Z  in wrap-around order: Z[0] to Z[size/2-1]
  6257.                 contain the CCF for zero and positive lags. Beginning with
  6258.                 the most negative lag in Z[size/2+1], the elements up to
  6259.                 Z[size-1] contain the CCF for negative lags. Since this
  6260.                 function assumes X to be periodic, the CCF for the most
  6261.                 positive lag is identical to the CCF for the most negative
  6262.                 lag. This element is stored as Z[size/2].
  6263.                 To get the CCF into normal order, you may call
  6264.                    VF_rotate( Z, Z, size, size/2 );
  6265.                 After that, the zero point is at the position size/2.
  6266.  
  6267.                 In case X is non-periodic, end effects should be avoided
  6268.                 by the methods described in connection with VF_convolve.
  6269.  
  6270.                 About special versions with the prefixes  VFs_  and VFl_,
  6271.                 consult chapter 4.8.
  6272. Error handling  If size is not a power of 2,  VF_FFT  (on which VF_xcorr
  6273.                 is based) complains "Size must be an integer power of 2"
  6274.                 and the program is aborted.
  6275. Return value    none
  6276. See also        VF_FFT,  VF_convolve,  VF_autocorr, VF_spectrum
  6277.  
  6278.  
  6279. ┌────────────────────────────────────────────────────────────────────────────┐
  6280. │ VI_xor              VSI_xor             VLI_xor             VQI_xor        │
  6281. │ VU_xor              VUS_xor             VUL_xor             VUI_xor        │
  6282. └────────────────────────────────────────────────────────────────────────────┘
  6283. Function        Bit-wise "XOR" operation.
  6284. Syntax          #include <VImath.h>
  6285.                 void VI_xor(  iVector Y, iVector X, ui size,  int C );
  6286.                 void VUL_xor( ulVector Y, ulVector X,  ui size,
  6287.                               unsigned long C );
  6288. Description     Yi  =  (Xi) ^ C
  6289.                 The bit-wise "exclusive OR" operation is performed on each
  6290.                 element Xi with the bit-mask given by C  (i.e., a bit is 0 in
  6291.                 Yi, if it was either 0 or 1 both in Xi and C simultaneously.
  6292.                 It is 1 if  Xi and C differed in this bit position).
  6293. Error handling  none
  6294. Return value    none
  6295. See also        VI_not,  VI_and,  VI_or
  6296.  
  6297.  
  6298. ┌────────────────────────────────────────────────────────────────────────────┐
  6299. │ VF_xprod                 VD_xprod                 VE_xprod                 │
  6300. └────────────────────────────────────────────────────────────────────────────┘
  6301. Function        Cross-product of two vectors.
  6302. Syntax          #include <VFstd.h>
  6303.                 void VF_xprod( fVector Z, fVector X, fVector Y );
  6304. Description     Z  =  X x Y
  6305.                 The cross- product of X and Y is calculated. Since this
  6306.                 operation is defined specifically for vectors representing
  6307.                 three dimensions in the geometrical sense, there is no
  6308.                 parameter "size" for this function. The number of elements
  6309.                 is 3 for each of the participating vectors, implicitly.
  6310. Error handling  none
  6311. Return value    none
  6312. See also        VF_scalprod, VF_Euclid
  6313.  
  6314.  
  6315. ┌────────────────────────────────────────────────────────────────────────────┐
  6316. │ VF_xyAutoPlot            VD_xyAutoPlot            VE_xyAutoPlot            │
  6317. │ VI_xyAutoPlot     VSI_xyAutoPlot       VLI_xyAutoPlot      VQI_xyAutoPlot  │
  6318. │ VU_xyAutoPlot     VUS_xyAutoPlot       VUL_xyAutoPlot      VUI_xyAutoPlot  │
  6319. └────────────────────────────────────────────────────────────────────────────┘
  6320. Function        Draws a Cartesian coordinate system and plots a Y-vector
  6321.                 against an X-vector into it.
  6322. Syntax          #include <Vgraph.h>
  6323.                 void VF_xyAutoPlot(  fVector X,  fVector Y,  ui size,
  6324.                                      unsigned form,   COLORREF color );
  6325. Description     A Cartesian coordinate system is drawn with automatic scaling
  6326.                 of the axes and the vector Y is plotted against the vector X.
  6327.                 Prior to calling VF_xyAutoPlot, the plotting routines have to
  6328.                 be initialized by V_initGraph (for DOS programs) or V_initPlot
  6329.                 (DOS or Windows programs).
  6330.  
  6331.                 The style of the plot is determined by the parameter form
  6332.                 which should be constructed using the symbolic constants
  6333.                 defined in <Vgraph.h>. For the line styles, either the BGI
  6334.                 notation or the Windows notation may be used both in DOS and
  6335.                 Windows programs; the necessary macros for the translation are
  6336.                 included in <Vgraph.h>.
  6337.  
  6338.                 1. Style of lines connecting adjacent data points:
  6339.                   PS_SOLID         SOLID_LINE            ____   (default)
  6340.                   PS_DOT           DOTTED_LINE           · · ·
  6341.                   PS_DASH          DASHED_LINE           - - -
  6342.                   PS_DASHDOT       CENTER_LINE           -·-·-
  6343.                   PS_DASHDOTDOT                          -··-··
  6344.                   PS_NULL          NULL_LINE             (no line at all)
  6345.  
  6346.                 2. Symbols used to mark data points:
  6347.                   SY_NULL              (no symbol at all)       (default)
  6348.                   SY_CROSS                   x
  6349.                   SY_PLUS                    +
  6350.                   SY_STAR                    *
  6351.                   SY_CIRCLE                  o
  6352.                   SY_BOX                     ▄
  6353.                   SY_DIAMOND                   
  6354.                   SY_TRIANGLEUP              
  6355.                   SY_TRIANGLEDOWN            
  6356.                      (if you loaded this file into a Windows program, some
  6357.                       symbols may have been lost during character conversion)
  6358.  
  6359.                 3. Fill-style of the symbols:
  6360.                   SY_HOLLOW         (no filling)              (default)
  6361.                   SY_FILLED         (filled)
  6362.                   SY_DOTTED         (hollow, with a dot at the exact
  6363.                                      position of the data point)
  6364.  
  6365.                 The parameter form has to be constructed by adding the
  6366.                 appropriate line style, the symbol and its fill-style, e.g.
  6367.                 (SOLID_LINE + SY_TRIANGLEUP). Alternatively, the bit-wise "OR"
  6368.                 operation may be used,  e.g.  (PS_SOLID | SY_CIRCLE |
  6369.                 SY_DOTTED).
  6370.  
  6371.                 If any of the line styles except NULL_LINE (or PS_NULL) is
  6372.                 chosen, each data point will be represented by at least one
  6373.                 pixel in DOS programs. Therefore, dotted or broken lines
  6374.                 should be specified only if there are not too many data
  6375.                 points. Otherwise, all line styles will eventually look like
  6376.                 SOLID_LINE. In Windows programs, these line styles will always
  6377.                 be plotted correctly and points will be left out if necessary.
  6378.  
  6379.                 Notice that  NULL_LINE or PS_NULL has to be explicitly
  6380.                 specified, if the data points are not to be connected by
  6381.                 lines. Just writing, e.g. (SY_BOX | SY_HOLLOW) would be
  6382.                 interpreted as using the default line style, which is
  6383.                 SOLID_LINE.
  6384.  
  6385.                 SY_NULL and SY_HOLLOW need not be specified, since these are
  6386.                 the default symbol and fill-style, resp. For SY_NULL,
  6387.                 SY_CROSS, SY_PLUS and SY_STAR, the choice of fill-style has no
  6388.                 effect.
  6389.  
  6390.                 The parameter color denotes the color that is to be used for
  6391.                 the plot (the data type COLORREF is unsigned for DOS programs
  6392.                 and unsigned long for Windows programs). See the Borland C++
  6393.                 function setcolor for a description of the colors available in
  6394.                 the various graphics modes under DOS. For Windows, the colors
  6395.                 BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY,
  6396.                 DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED,
  6397.                 LIGHTMAGENTA, YELLOW, and WHITE are defined in <Vgraph.h> by
  6398.                 analogy with the COLORS defined in <graphics.h> for the BGI
  6399.                 routines, i.e. for DOS programs. Thereby, portability between
  6400.                 DOS and Windows programs is improved. For programs designed to
  6401.                 run exclusively under Windows, it is nevertheless recommended
  6402.                 to use fine-tuned colors defined by the RGB macro, instead of
  6403.                 the predefined colors.
  6404.  
  6405.                 The size of the symbols may be modified with the function
  6406.                 V_setSymbolSize. The thickness of the lines may be modified
  6407.                 using V_setLineThickness.
  6408.  
  6409. Example of a DOS program:
  6410.                 #include <VFstd.h>
  6411.                 #include <VFmath.h>
  6412.                 #include <Vgraph.h>
  6413.                 #include <conio.h>
  6414.                 void main( void )
  6415.                 {
  6416.                      ui       size=101;
  6417.                      fVector  X,  Y1,   Y2;
  6418.  
  6419.                      V_initGraph( "C:\\BorlandC\\BGI\\" );
  6420.                             /* Be sure the path is correct! */
  6421.                      X  = VF_vector( size );
  6422.                      Y1 = VF_vector( size );
  6423.                      Y2 = VF_vector( size );
  6424.                      VF_ramp( X, size, -1.0, 2.0/100 );
  6425.                      VFx_sincos( Y1, Y2, X, size, 3.1415927, 0.0, 1.0 );
  6426.                      VF_xyAutoPlot( X, Y1, size,
  6427.                                     PS_SOLID | SY_CROSS,
  6428.                                     LIGHTGREEN );
  6429.                      VF_xyDataPlot( X, Y2, size,
  6430.                                     PS_SOLID | SY_CIRCLE | SY_DOTTED,
  6431.                                     LIGHTRED );
  6432.                      getch();      /* interrupt execution while watching;
  6433.                                       then press any key  */
  6434.                      closegraph();
  6435.                      V_nfree( 3, Y2, Y1, X );
  6436.                 }
  6437.  
  6438.                 Under Windows, call V_initPlot instead of V_initGraph, before
  6439.                 performing plotting operations.
  6440. Error handling  none
  6441. Return value    none
  6442. See also        VF_xyAutoPlot,  VF_yAutoPlot,  VCF_autoPlot, V_drawAxes,
  6443.                 V_findAxes, V_setSymbolSize,  chapter 4.11
  6444.  
  6445.  
  6446. ┌────────────────────────────────────────────────────────────────────────────┐
  6447. │ VF_xy2AutoPlot           VD_xy2AutoPlot           VE_xy2AutoPlot           │
  6448. │ VI_xy2AutoPlot    VSI_xy2AutoPlot      VLI_xy2AutoPlot     VQI_xy2AutoPlot │
  6449. │ VU_xy2AutoPlot    VUS_xy2AutoPlot      VUL_xy2AutoPlot     VUI_xy2AutoPlot │
  6450. └────────────────────────────────────────────────────────────────────────────┘
  6451. Function        Draws a Cartesian coordinate system and plots two X-Y vector
  6452.                 pairs into it.
  6453. Syntax          #include <Vgraph.h>
  6454.                 void VF_xy2AutoPlot(   fVector X1, fVector Y1, ui size1,
  6455.                                        unsigned form1, COLORREF color1,
  6456.                                        fVector X2, fVector Y2, ui size2,
  6457.                                        unsigned form2, COLORREF color2 );
  6458. Description     The vector Y1 is plotted against the vector X1 and Y2 against
  6459.                 X2 after automatically drawing a Cartesian coordinate system.
  6460.                 For a description of the parameters form1, form2, and color1,
  6461.                 color2, see VF_xyAutoPlot. Prior to calling VF_xy2AutoPlot,
  6462.                 the plotting routines have to be initialized by V_initGraph or
  6463.                 V_initPlot.
  6464. Error handling  none
  6465. Return value    none
  6466. See also        VF_xyAutoPlot,  VF_yAutoPlot,  VCF_autoPlot, V_drawAxes,
  6467.                 V_findAxes
  6468.  
  6469.  
  6470. ┌────────────────────────────────────────────────────────────────────────────┐
  6471. │ VF_xyDataPlot            VD_xyDataPlot            VE_xyDataPlot            │
  6472. │ VI_xyDataPlot     VSI_xyDataPlot       VLI_xyDataPlot      VQI_xyDataPlot  │
  6473. │ VU_xyDataPlot     VUS_xyDataPlot       VUL_xyDataPlot      VUI_xyDataPlot  │
  6474. └────────────────────────────────────────────────────────────────────────────┘
  6475. Function        X-Y-plot into an existing Cartesian coordinate system.
  6476. Syntax          #include <Vgraph.h>
  6477.                 void VF_xyDataPlot( fVector X,  fVector Y,  ui size,
  6478.                                     unsigned form,  COLORREF color );
  6479. Description     The vector Y is plotted against the vector X into a Cartesian
  6480.                 coordinate system drawn by a prior call to one of the AutoPlot
  6481.                 functions or to V_drawAxes. For a description of the parameters
  6482.                 form and color, see VF_xyAutoPlot.
  6483. Error handling  none
  6484. Return value    none
  6485. See also        VF_xyAutoPlot,  VF_yAutoPlot,  VCF_autoPlot, V_drawAxes,
  6486.                 V_findAxes
  6487.  
  6488.  
  6489. ┌────────────────────────────────────────────────────────────────────────────┐
  6490. │ VF_yAutoPlot             VD_yAutoPlot             VE_yAutoPlot             │
  6491. │ VI_yAutoPlot      VSI_yAutoPlot        VLI_yAutoPlot       VQI_yAutoPlot   │
  6492. │ VU_yAutoPlot      VUS_yAutoPlot        VUL_yAutoPlot       VUI_yAutoPlot   │
  6493. └────────────────────────────────────────────────────────────────────────────┘
  6494. Function        Draws a Cartesian coordinate system and plots each element of
  6495.                 a Y-vector against its index.
  6496. Syntax          #include <Vgraph.h>.
  6497.                 void VF_yAutoPlot( fVector Y, ui size,
  6498.                                    unsigned form, COLORREF color );
  6499. Description     A Cartesian coordinate system is automatically scaled and
  6500.                 drawn. Each element of the vector Y is plotted against its
  6501.                 index into this coordinate system. For a description of the
  6502.                 parameters form and color, see VF_xyAutoPlot. The plotting
  6503.                 routines have to be initialized by V_initGraph or V_initPlot
  6504.                 prior to calling VF_yAutoPlot.
  6505. Error handling  none
  6506. Return value    none
  6507. See also        VF_yDataPlot,  VF_y2AutoPlot,   VF_xyAutoPlot, VCF_autoPlot,
  6508.                 V_drawAxes, V_findAxes,  chapter 4.11
  6509.  
  6510.  
  6511. ┌────────────────────────────────────────────────────────────────────────────┐
  6512. │ VF_y2AutoPlot            VD_y2AutoPlot            VE_y2AutoPlot            │
  6513. │ VI_y2AutoPlot     VSI_y2AutoPlot       VLI_y2AutoPlot      VQI_y2AutoPlot  │
  6514. │ VU_y2AutoPlot     VUS_y2AutoPlot       VUL_y2AutoPlot      VUI_y2AutoPlot  │
  6515. └────────────────────────────────────────────────────────────────────────────┘
  6516. Function        Draws a Cartesian coordinate system and plots two Y-vectors,
  6517.                 taking the index as the X-axis.
  6518. Syntax          #include <Vgraph.h>
  6519.                 void VF_y2AutoPlot(   fVector Y1, ui size1,
  6520.                                       unsigned form1, COLORREF color1,
  6521.                                       fVector Y2, ui size2,
  6522.                                       unsigned form2, COLORREF color2 );
  6523. Description     A Cartesian coordinate system is automatically scaled and
  6524.                 drawn. Each element of the vectors Y1 and Y2 is plotted at the
  6525.                 X-position given by its index. For a description of the
  6526.                 parameters form1, form2, and color1, color2, see
  6527.                 VF_xyAutoPlot. The plotting routines have to be initialized by
  6528.                 V_initGraph or V_initPlot prior to calling VF_yAutoPlot.
  6529. Error handling  none
  6530. Return value    none
  6531. See also        VF_yDataPlot,  VF_y2AutoPlot,   VF_xyAutoPlot, VCF_autoPlot,
  6532.                 V_drawAxes, V_findAxes,  chapter 4.11
  6533.  
  6534.  
  6535. ┌────────────────────────────────────────────────────────────────────────────┐
  6536. │ VF_yDataPlot             VD_yDataPlot             VE_yDataPlot             │
  6537. │ VI_yDataPlot      VSI_yDataPlot        VLI_yDataPlot       VQI_yDataPlot   │
  6538. │ VU_yDataPlot      VUS_yDataPlot        VUL_yDataPlot       VUI_yDataPlot   │
  6539. └────────────────────────────────────────────────────────────────────────────┘
  6540. Function        Plots a Y-vector into an existing Cartesian coordinate system,
  6541.                 taking the index as the X-axis.
  6542. Syntax          #include <Vgraph.h>
  6543.                 void VF_yDataPlot(   fVector Y, ui size,
  6544.                                      unsigned form, COLORREF color );
  6545. Description     Each element of the vector Y is plotted into a Cartesian
  6546.                 coordinate system that has to be already drawn by a prior call
  6547.                 to one of the AutoPlot functions or to V_drawAxes. The X-
  6548.                 position is given by the index of the Y-element to be plotted.
  6549.                 For a description of the parameters form and color, see
  6550.                 VF_xyAutoPlot.
  6551. Error handling  none
  6552. Return value    none
  6553. See also        VF_yAutoPlot,  VF_y2AutoPlot,   VF_xyAutoPlot, VCF_autoPlot,
  6554.                 V_drawAxes, V_findAxes,  chapter 4.11
  6555.  
  6556.  
  6557.  
  6558.  
  6559.  
  6560. ****************************************************************************
  6561. *                                                                          *
  6562. *******            9. Non-vectorized Functions                       *******
  6563. *                                                                          *
  6564. *****************************************************************************
  6565.  
  6566. There are a few non-vectorized functions, stemming from CMATH and XMATH,
  6567. which are necessary to use VectorLib. They are described here:
  6568.  
  6569. ┌────────────────────────────────────────────────────────────────────────────┐
  6570. │ fcplx                    dcplx                    ecplx                    │
  6571. └────────────────────────────────────────────────────────────────────────────┘
  6572. Function        Initialization of complex numbers
  6573. Syntax          #include <VecLib.h>
  6574.                 fComplex  fcplx( float ReVal, float ImVal );
  6575.                      (similarly dcplx,  ecplx)
  6576. Description     These functions allow to generate complex numbers of the three
  6577.                 complex data types fComplex, dComplex, and eComplex.
  6578.                 CMATH offers overloaded versions of these functions for C++.
  6579.                 See CMATH.TXT for details.
  6580.                 fcplx should be used, whenever temporary complex variables
  6581.                 are needed as arguments for functions. In this case, fcplx
  6582.                 replaces the less elegant direct assignment of the real
  6583.                 and imaginary parts.
  6584. Example         z.Re = 3.0;  z.Im = 4.0;
  6585.                 VCF_equC( X, size, z );     /* less convenient */
  6586.                 VCF_equC( Y, size, fcplx( 3.0, 4.0 ));  /* easier */
  6587. Error handling  none
  6588. Return value    the generated complex number
  6589.  
  6590.  
  6591. ┌────────────────────────────────────────────────────────────────────────────┐
  6592. │ quadtod                  _quadtold                                         │
  6593. └────────────────────────────────────────────────────────────────────────────┘
  6594. Function        convert a quad into a double or long double.
  6595. Syntax          #include <VecLib.h>
  6596.                 double          quadtod( quad x );
  6597.                 long double   _quadtold( quad x );
  6598. Description     These functions, along with their counterpart, setquad,
  6599.                 provide the necessary interface for the use of the data type
  6600.                 quad within Borland C/C++. If, e.g., the value of a quad
  6601.                 (say, of x) has to be printed, this must be done by a
  6602.                 function call like
  6603.                      printf( "% 20.0Lf",  _quadtold( x ));
  6604. Error handling  none
  6605. Return value    the value of x is returned as a double or long double.
  6606.  
  6607.  
  6608. ┌────────────────────────────────────────────────────────────────────────────┐
  6609. │ isint                    isintl                                            │
  6610. └────────────────────────────────────────────────────────────────────────────┘
  6611. Function        tests if a number is a whole number
  6612. Syntax          #include <xmath.h>
  6613.                 int  isint( double x );
  6614.                 int  isintl( long double x );
  6615. Description     Returns TRUE (a value different from 0), if x is an integer
  6616.                 number. FALSE (a value of 0) is returned, if x contains a non-
  6617.                 zero fractional part.
  6618. Error handling  none
  6619. Return value    see above
  6620.  
  6621.  
  6622. ┌────────────────────────────────────────────────────────────────────────────┐
  6623. │ log2                     log2l                                             │
  6624. └────────────────────────────────────────────────────────────────────────────┘
  6625. Function        Binary logarithm
  6626. Syntax          #include <xmath.h>
  6627.                 double       log2( double x );
  6628.                 long double  log2l( long double x );
  6629. Description     The logarithm of the argument to the basis 2 is calculated and
  6630.                 the result returned.
  6631. Error handling  A DOMAIN error with  NAN ("not-a-number") as return value
  6632.                 results from x < 0 (including -0). A  SING  error with
  6633.                 -HUGE_VAL as return value results from x=0. The handling of
  6634.                 both errors can be modified via _matherr or _matherrl, resp.
  6635. Return value    The binary logarithm of the argument is returned.
  6636. See also        log, logl,  log10, log10l,  VF_log2
  6637.  
  6638.  
  6639. ┌────────────────────────────────────────────────────────────────────────────┐
  6640. │ setquad                                                                    │
  6641. └────────────────────────────────────────────────────────────────────────────┘
  6642. Function        converts a long double into a quad.
  6643. Syntax          #include <VecLib.h>
  6644.                 quad  setquad( long double x );
  6645. Description     This function, along with its counterparts, quadtod and
  6646.                 _quadtold, provides the necessary interface for the use of the
  6647.                 data type quad within Borland C/C++. If, e.g.,  quad
  6648.                 parameters are required by a function, they have to be passed
  6649.                 either as existing variables of this data type or as in the
  6650.                 following example:
  6651.                     VQI_addC( QI2, QI1,size, setquad( 53563369.L ));
  6652. Error handling  none
  6653. Return value    the value of x is returned as a quad.
  6654.  
  6655.  
  6656.  
  6657. ****************************************************************************
  6658. *                                                                          *
  6659. *******               10. VectorLib Error Messages                   *******
  6660. *                                                                          *
  6661. ****************************************************************************
  6662.  
  6663.  
  6664. Just as with any C or C++ program, errors occurring within mathematical
  6665. functions lead to the appropriate error messages. See chapter 5 of this
  6666. documentation (in the file HANDBOOK.TXT) and the description of _matherr
  6667. in the Borland C++ documentation for details. Apart from math errors, there
  6668. are some run-time errors specific to VectorLib routines. These errors lead to
  6669. the messages noted below. The name of the function where the error occurred
  6670. is not always exactly the name you wrote in your program. Instead of the
  6671. prefix VI_, the message will read VLI_ or VSI_, depending on the memory model
  6672. used. Similarly, instead of VU_, you will find VUL_ or VUS_, and VFs_FFT or
  6673. VFl_FFT is substituted for VF_FFT, again depending on the memory model.
  6674. The reason for this behavior is that many functions share code and even names.
  6675.  
  6676. ┌────────────────────────────────────────────────────────────────────────────┐
  6677. │ Cannot free non-existent vector.                                           │
  6678. └────────────────────────────────────────────────────────────────────────────┘
  6679. You called V_free or V_nfree for a vector that has no memory allocated.
  6680. Program execution is continued without freeing anything.
  6681.  
  6682. ┌────────────────────────────────────────────────────────────────────────────┐
  6683. │ Cannot scale symbols by more than a factor of 50.                          │
  6684. └────────────────────────────────────────────────────────────────────────────┘
  6685. (Windows only.) The symbols used in VectorLib plotting functions cannot be
  6686. magnified by more than a factor of 50 (which means already filling the screen
  6687. with a single symbol). Program execution is continued with a value of 50.0.
  6688.  
  6689. ┌────────────────────────────────────────────────────────────────────────────┐
  6690. │ Cannot use line thicker than 500 pixels.                                   │
  6691. └────────────────────────────────────────────────────────────────────────────┘
  6692. (Windows only.) The lines used in VectorLib plotting functions cannot be
  6693. thicker than 500 pixels (which is already nonsense). Program execution is
  6694. continued with a value of 500.
  6695.  
  6696. ┌────────────────────────────────────────────────────────────────────────────┐
  6697. │ Cannot use requested format (too many entries per line).                   │
  6698. └────────────────────────────────────────────────────────────────────────────┘
  6699. This error occurs with the printing functions. The parameter nperline was
  6700. chosen too large. The function automatically selects the maximum nperline
  6701. possible and continues execution, but you should nevertheless consider
  6702. adapting your program.
  6703.  
  6704. ┌────────────────────────────────────────────────────────────────────────────┐
  6705. │ Invalid parameter(s).                                                      │
  6706. └────────────────────────────────────────────────────────────────────────────┘
  6707. In some functions, certain combinations of input parameters are illegal. For
  6708. example, it is not possible to perform a 9-point interpolation on only 5
  6709. data points.
  6710.  
  6711. ┌────────────────────────────────────────────────────────────────────────────┐
  6712. │ Not enough memory.                                                         │
  6713. └────────────────────────────────────────────────────────────────────────────┘
  6714. You are trying to allocate memory, but there is not enough left. This error
  6715. occurs during calls to VF_vector etc. or to functions which need to allocate
  6716. their own working space. Try these solutions:
  6717. *   Look out for vectors that might be no longer needed and free them as soon
  6718.     as possible. Be sure that any vectors allocated in subroutines are freed
  6719.     before leaving the subroutine.
  6720. *   If you need to work with large amounts of data, the memory model FLAT
  6721.     should be used, working with Win32, WindowsNT, or Windows95.
  6722. *   Store data intermediately on disk, using VF_store, and retrieve them
  6723.     using VF_recall, when needed. This method is slow and should be used only
  6724.     if really necessary.
  6725.  
  6726. ┌────────────────────────────────────────────────────────────────────────────┐
  6727. │ Not possible with fewer than n elements.                                   │
  6728. └────────────────────────────────────────────────────────────────────────────┘
  6729. Some functions require a minimum size of n elements of the vector processed.
  6730.  
  6731. ┌────────────────────────────────────────────────────────────────────────────┐
  6732. │ Not possible with more than n elements.                                    │
  6733. └────────────────────────────────────────────────────────────────────────────┘
  6734. Some functions are limited to a maximum size of n elements. This is true,
  6735. for example, for VF_polyinterpol, where only up to 10 table elements may be
  6736. used for the each interpolation.
  6737.  
  6738. ┌────────────────────────────────────────────────────────────────────────────┐
  6739. │ Size must be an integer power of 2.                                        │
  6740. └────────────────────────────────────────────────────────────────────────────┘
  6741. For all functions using - explicitly or implicitly - Fast Fourier Transform
  6742. methods, the size has to be an integer power of 2. Enlarge or truncate your
  6743. vector(s) to meet that condition.
  6744.  
  6745. ┌────────────────────────────────────────────────────────────────────────────┐
  6746. │ Vector > 64 kB not possible.                                               │
  6747. └────────────────────────────────────────────────────────────────────────────┘
  6748. *    Either you are trying to allocate a vector whose size exceeds 64 kB in
  6749.      a memory model other than HUGE or FLAT. If you need larger vectors, you
  6750.      have to switch to one of these models.
  6751. *    Or you are already in the HUGE model and attempt to process a huge vector
  6752.      in a function where the size is limited to 64 kB even in the HUGE model.
  6753.      This might happen, e.g., if the table is too large in one of the
  6754.      interpolation routines. In this case, you must either use the model FLAT
  6755.      or split up your problem into smaller vectors.
  6756.  
  6757. ┌────────────────────────────────────────────────────────────────────────────┐
  6758. │ Vectors must not be identical.                                             │
  6759. └────────────────────────────────────────────────────────────────────────────┘
  6760. In some functions where more than one input vector is used to calculate more
  6761. than one output vector, attention has to be paid, which output vector may or
  6762. may not overwrite which input vector. See the specification of the function
  6763. where the error occurred.
  6764.  
  6765.  
  6766. ****************************************************************************
  6767. *                                                                          *
  6768. *******                      E  N  D                                 *******
  6769. *                                                                          *
  6770. *****************************************************************************
  6771. ****************************************************************************
  6772.  
  6773. Copyright for OptiVec software and documentation
  6774. (C) 1996-1998 Martin Sander.
  6775. All rights reserved!
  6776.